FCP capturing audio in mono

Hi,
I've just captured some footage that I filmed earlier, and FCP says that it's a mono track, and I checked the camera, and it's set to record in stereo.
Any thoughts.

hi david
is there any way of recapturing the clips in stereo, using the settings in your log and capture window?
i have gone through a bunch of tapes logging and capturing maybe 6 hours of footage, only to find that they come into the timeline with 1 video and 1 mono audio track (left). now if i could edit the log and change the setting to stereo, maybe i can recapture without the need to log everything again.
hoping...
hannes

Similar Messages

  • FCP Capturing & Audio

    I'm working with FCP 4 (purch. upgrade on Amazon - I know, I know I'm working in the dark ages), and can't hear audio thru my speakers when capturing; however the audio meter registers sound, and there is sound when playing back the clip after capture. I've been working with an even older version of FCP, and it plays audio thru my external speakers while capturing. Was this feature removed in newer versions of the software in order to eliminate some sort of problem? Or, is there an audio setting I'm overlooking that allows audio playing while capturing?
    Any info would be muchly appreciated!
    Craig

    for versions prior to 5 you have to edit your Capture Preset:
    Final Cut Pro > Audio/Video Settings > Capture Presets > Edit > Quicktime Audio Settings > Advanced > Speaker On
    tutorial with pictures

  • Capturing audio from telephone for use in FCP

    My requirement is quite specific, and so far none of previous posts seem to answer my question. So...
    I'm looking to capture audio from my telephone for use in FCP. It won't be a telephone conversation, but a voice text. In other words, an SMS sent to a landline. The audio is saved as a voice message on the answer machine. My phone / answer machine is fairly basic - it has a speaker and the only ports it has is for power and the telephone line itself. I have tried a very basic method of playing the message on speaker and capturing it on a mini DV - but that results in too much audio edit to get it to sound acceptable. My Mac is a G5 and I have the full FC studio, but just not sure of best way to get audio onto the Mac without losing too much of the sound quality.
    Any suggestions?
    Many thanks all...
    Kirsten
    iMac G5    
    iMac G5    

    you need a telephone audio interface like the products made by the fine folks at gentner, telos or jk audio. i have a celltap from jk audio, works very very well. http://www.jkaudio.com/celltap.htm

  • I cannot capture Audio

    MacBook Pro 2.33 GHz
    Final Cut Pro 5.1.4
    Quicktime Pro 7.1.5
    JVC Camcorder GR-DV4000E
    Connected via firewire direct to the MacBook
    I have reinstalled Quicktime and trashed the FCP preferences.
    When I go to Audio/Video settings>Capture Presets and edit my DV PAL 48 kHz settings under Quicktime Video Settings I get [Missing] DV Video and under Quicktime Audio Settings [Missing] DV Audio.
    In the digitizer menu under Quicktime Video Settings there is an item DV Video. If I select DV Video it does show next to input my camcorder (GR-DV4000). But when I select DV Video, there is not anymore a setting DV Audio in the menu under Quicktime Audio Settings (not even the [Missing] DV Audio setting).
    This behavior does not change if I select View>Reset AV Devices.
    I can capture video, but though there seems to be an audio file, it is silent. If I select Show Audio Waveforms in the timeline, there is no waveform visible. The viewer does have a stereo tab but it shows no (visible) audio waveforms.
    In System Settings, Capture Audio and Video to Separate Files is disabled. Enabling this does not make any difference.
    Is this a known bug? Anything I do wrong? Anything I could try?
    MacBook Pro Mac OS X (10.4.9) 2 GB Memory
    MacBook Pro Mac OS X (10.4.9) 2 GB Memory
    MacBook Pro Mac OS X (10.4.9) 2 GB Memory
    MacBook Pro Mac OS X (10.4.9) 2 GB Memory
    MacBook Pro Mac OS X (10.4.9) 2 GB Memory
    MacBook Pro Mac OS X (10.4.9) 2 GB Memory
    MacBook Pro Mac OS X (10.4.9) 2 GB Memory
    MacBook Pro   Mac OS X (10.4.9)   2 GB Memory

    Were the capture settings and any other settings the
    same for your test with the powerbook?
    Have you successfully captured on your macbook pro
    prior to your current problems?
    If so, have you made any changes to your system,
    software updates, system updates, Third party apps or
    plugins?
    In your original post you mention that though
    there seems to be an audio file, it is silent
    what exactly does this mean? Do you get a green
    audio track after capturing, but it is silent? Is
    there any movement in the levels meter (next to the
    toolbar)? Is there definitely audio on the tape(s)
    in question (do you hear it playing it on the cam?)
    Do any other tapes work?
    When I originally asked what the capture settings
    are, I was wondering if you have set FCP to capture
    audio from Ch1 when it was recorded to Ch2 on the
    camera i.e are you capturing audio 'Ch1 + Ch2', Ch1
    (L), CH2 (R), 'Stereo', 'Mono mix'?
    The Capture settings were exactly the same.
    This is the first time I try to capture on the MacBook Pro.
    I used the migration assistant to transfer my software on the Powerbook to the MacBook Pro.
    I get 4 green audio tracks that are silent. There is no movement in the audio meters, nor on the timeline, nor in the capture window.
    There is audio on the tapes. I have captured 11 different tapes that are all silent. Everything works on the Powerbook. The sound on the tapes is 16 bit stereo. Capture was set to record Left and Right linked as a stereo file.
    I think this happens because I cannot select DV Audio in the Audio/Video Settings.
    The strange thing is that I get [Missing] DV Video and [Missing] DV Audio in the Audio/Video Settings. In the menu under Video Settings I can select DV Video, but when I select this, there is no more DV Audio in the menu under Audio Settings.
    The tapes were captured with [Missing] DV Video and [Missing] DV Audio. This captures the video but not the audio.
    MacBook Pro Mac OS X (10.4.9) 2 GB Memory

  • Strange export result in FCP 7- audio and video output not in sync anymore

    I have a problem exporting edited videomaterial. After export audio and video they are not in sync anymore. There's a difference of 8 sec when exporting audio and video separatly. Movie is total 61 min long.
    Video and sequence settings are HDV1080i50, 25fps, 48khz, 16 bit, mono.
    What could that be ?

    Well now that I look at all the clips in FCP more closely I see some clips from the same tape are in sync and others are out of sync.  And one section of tape which I captured twice was in sync on one clip and out of sync on the other.  So it can't be the tapes.
    Maybe the sync problem is caused by not coordinating the tape playing and FCP capturing properly every time! So I will try re-capturing the problem sections of tape.

  • Unable to capture audio from BlackMagic HD Extreme via Voice Over tool

    Hi !
    I'm trying to capture audio via my BlackMagic HD Extrem card using the Voice Over tool in FCP6, but I can't, no audio is incoming.
    I can ingest audio with video using log and capture, then I know my card and my cables are working.
    I tried to set the BM card as audio input in my Audio's System Prefereces Pane, but it isn't working either.
    I've been looking on the BM website, but I found nothing.
    Can you help me ?
    Thx

    Thanks for the reply.
    Looking at system preferences I found that audio input was set microphone. Don't know how it happened. I switched it to DeckLink and now FCP displays 16 input channels in Log and Capture dialog. I didn't try to capture yet but I think it solved the problem, because before I had only two channels displyed.

  • Capturing audio only in fcp5

    I am rather new to Final Cut Pro 5 and have been trying to teach myself as I go along. I am, however, having trouble capturing audio seperate from video. I am shooting a 16mm film and need to capture audio and video to seperate files in order to synch them for edit. While I am able to capture straight video (i.e. without audio) I am unable to capture straight audio (i.e. without video in the same file). The only way that I have been able to capture audio is if some form of video is captured along with it. How can I capture an audio only file. I am using FCP 5 on a PowerBook G4 - capturing through a "Dazzle Hollywood DV Bridge" with a Canon ZR 45 for video and a Sony TCD D8 portable DAT for audio. Any information is greatly appreciated and I patiently await your response(s).
    Thank you,
    Tayman Strahorn

    I am rather new to Final Cut Pro 5 and have been trying to teach myself as I go along. I am, however, having trouble capturing audio seperate from video. I am shooting a 16mm film and need to capture audio and video to seperate files in order to synch them for edit. While I am able to capture straight video (i.e. without audio) I am unable to capture straight audio (i.e. without video in the same file). < </div>
    My welcome also but, as a beginner, you really need to run the tutorials and learn how to use the resources you paid for when you got your applications.
    Look in the online help system for audio only. Look in the manual index for audio only. Examine the chapter on capturing.
    How are you doing Video Only if you don't understand the Clip Settings function or where it is located?
    You can force DV to build separate audio and video files while capturing but it's not recommended (dunno why not). If you force separate files, you can simply delete the ones you don't want.
    bogiesan

  • Capturing Audio from DAT

    Hello,
    I'm trying to capture audio from a DAT deck (Tascam DA-20) into FCP HD by routing it through my JVC BR-DV600U DV deck (RCA output from DAT, RCA input to DV deck, Firewire into FCP).
    The DV deck's input is set to line-in, and the audio is being routed through (audio meters on DV deck mimic those on DAT deck, and I can hear the audio through the headphones jacked into my DV deck).
    However, when I try to capture the audio on FCP, I am unsuccessful, prompting the following window from FCP: "Error: Final Cut Pro HD was unable to read the movie file just captured."
    Now, I use the same set up I described above to capture footage from my Beta deck into FCP with no problems (route Beta signal through DV deck and firewire it into FCP). This leads me to believe that perhaps the glitch lies within my Capture Presets.
    At first, I tried to capture the signal as an Audio-Only DV NTSC 48 Khz/Non-controllable device. After that failed, I tried to create my own capture preset, but am not sure it will make a difference, as the only input choices I am given are DV Audio, Built-In Audio, and None.
    Any suggestions?
    Thanks.

    Why not capture the audio content outside of FCP, check the sample rate for 48Khz/16-bit, convert if necessary, save as an AIFF file, and then import that resulting sound file into FCP?
    Any good audio app, including STP will do captures.
    You are probably going to need to do some cleanup on the audio anyway before you use it, so why not just use an audio app to do it beforehand?
    Besides, if you have an audio device (PCI card or Firewire device) in your Mac, you can use the S/PDIF port for your connection to the DAT and do a digital transfer when you import.
    As I understand the way you are doing it now, you are taking digital content from the DAT, converting it to analog for the connection into your deck, and then re-converting it into digital when you capture it back into FCP.
    One big advantage of digital audio (and video) is to avoid generation loss and added noise during transfer if you go D-to-D.
    If you don't have an audio card or Firewire A/D audio I/O device with S/PDIF ports in your Mac, then see if you can find a friend who has one and can do the transfer for you. Then he can give you the file on a CD-ROM.
    That's what I'd do.

  • A/V out-of-sync issue for FCP captures

    I've read many of the out-of-sync posts on this board, most of which seem to indicate that the problem is usually caused by either dropped frames, bad timecode breaks, edit errors, or disunity between FCP capture and sequence settings, compared with audio sample rates for the underlying files.
    My files, shot on my Panasonic AG-DVX100A in 24pa mode, result in perfect (except for the anamorphic screen size - see my next post!) Quicktime movie files, in perfect sync. It's only when I create clips from those files in FCP that the video and audio go out of sync. And the out-of-sync drifts; that is, the further you go in the clip, the more out of sync the sound and the video gets.
    My camera is always set to the 24pa mode, which, by default, records only in the non-drop-frame mode, regardless of any other camera settings I may have selected. The audio settings in my camera (and in the resulting underlying QT files that are created when I capture in FCP) are 16-bit integer and 48.000 khz, as they are in both my FCP sequence presets and capture presets, so I don't think it's an issue of conflicting sample rates. My device control presets are for Firewire NTSC NDF (non dropped frame).
    Given the above information, does anyone have any idea what else I might be doing wrong? I've already shot hundreds of hours of footage last year that worked fine. I don't know what I changed to cause this out-of-sync problem now, but I'm going bald tearing out my hair trying to figure it out.
    Thanks in advance for your help!
    - Mick Raton
    Dual 2 GHz PowerPC G5   Mac OS X (10.4.7)   5 GB DDR SDRAM; Final Cut Studio 5.0.4; Panasonic AG-DVX100A

    The dvd recorder was in the loop when the sync issue showed up.  the dvd was in sync but the live stream, next in line, was out of sync.  I have returned to using the older machine with xp.  (the lap top is running vista)  The older machine is a desktop which requires more space on the production table and time to set up.

  • Problem capturing audio

    Hello!!
    I am trying to capture audio using jmf 2.1.1.e in Linux (SuSE 8.1) with jdk 1.4.2_04. I have "alsa" properly installed. However, when I try to capture using jmstudio, I am shown "javaSound audio", LINEAR, 44100 Hz, 16 bits, stereo, little endian and after cliking OK I get :"Could't initialize the Capture Device".
    I also try to run a code to capture audio, using the following:
    Vector audioDevices = CaptureDeviceManager.getDeviceList(new AudioFormat(AudioFormat.LINEAR, 44100, 16, 2));
    CaptureDeviceInfo audioCDI = (CaptureDeviceInfo)audioDevices.elementAt(0); //I get javaSound
    ds = Manager.createDataSource(audioCDI.getLocator());
    processor = javax.media.Manager.createProcessor(ds);
    But I get the following exception:
    LINEAR, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 44100.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 22050.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 22050.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 11025.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 11025.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 8000.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 8000.0 Hz, 16-bit, Mono, LittleEndian, Signed
    Audio not supported: interface TargetDataLine supporting format PCM_SIGNED, 44100.0 Hz, 16 bit, stereo, little-endian, audio data, and buffers of 22050 to 22050 bytes
    Audio not supported: interface TargetDataLine supporting format PCM_SIGNED, 44100.0 Hz, 16 bit, stereo, little-endian, audio data, and buffers of 22050 to 22050 bytes
    java.io.IOException: Cannot open audio device for input.
    javax.media.NoDataSourceException: Error instantiating class: com.sun.media.protocol.javasound.DataSource : java.io.IOException: Cannot open audio device for input.
    at javax.media.Manager.createDataSource(Manager.java:1012)
    at AVTransmit2.createProcessor(AVTransmit2.java:136)
    at AVTransmit2.start(AVTransmit2.java:54)
    at AVTransmit2.main(AVTransmit2.java:553)
    Exception in thread "main" java.lang.NullPointerException
    at AVTransmit2.waitForState(AVTransmit2.java:460)
    at AVTransmit2.createProcessor(AVTransmit2.java:188)
    at AVTransmit2.start(AVTransmit2.java:54)
    at AVTransmit2.main(AVTransmit2.java:553)
    Has anybody ever had this problem?? Do you know where the problem is? Do you know how to solve it??
    Could you be so kind as to help me, please???
    Thank you very much in advance.

    Hi wew64.
    I m new to JMF. I just made a simple media player not any more. can you please tell me what is "alsa" and "arts".
    actually I want to control my Sound card properties like "Microphone, Line In, etc...." is it possible in java if it is please tell me.
    I will be very thankful to you
    I m very upset about it because it is minimum 3-weeks late, my project is pending on this stage. All i want to do, just to mute the volume of "line in" (property in my sound card, which takes audio data from a TvTunner card and leaves this audio data out to the speakers.)so that only the audio from my computer's( any application like media player) can goes to the speakers, not the audio comming from the TvTunner(My TvTunner is opperated by the application provided by the vendor, I did not develop this on my own in java. I just made my media player in java). Yes this is the PROBLEM that both audios from TvTunner card and from My Application are being transmitted to speakers simultanously. But i want, when my application is running, the audio comming from TvTunner should be muted and when my application is exited, the TvTunner's audio should be unmuted. And this is only done by Line In property because Audio from TvTunner card is got by the Sound card through the Line In property.
    I tried my best to find out the solution but could not get any thing right.
    Please Help me
    thanks
    Khurram

  • Can't capture audio in  stereo pair

    I have FCE HD 3.0 and the audio capture default has always been stereo pair. Just now, since having to trash preferences, the default capture is now mono. Thanks to the forum, I know how to modify>link stereo in the timeline, but could anyone explain how I could reset preference to capture audio stereo?

    You can't.

  • How do I capture audio only, no video?

    I'm trying to capture an audio cassette, patched RCA/XLR to a Kona Card, to a G5 tower running FCP6. Since I want to capture audio only, I unchecked the video box in the clip settings tab of the LogCapture window. But when I capture now, I get a message saying "This operation could not be completed as there is no video".
    How can I capture audio only? Can't turn off the video in Kona ctrl panel, must be in FCP.
    Thanks in advance for the help.

    Yes, as I mentioned, I did uncheck that video box, after which I got the message 'operation could not be completed as there is no video' (& capture failed). My capture setting is to Kona, but I've also tried Generic, but no luck.
    This then led to my first crash course in SoundtrackPro, which is now recording the audio I needed. But I would love to figure out why FCP is not letting me capture audio w/o video, so any further suggestions are appreciated.

  • Does Logic 9 Support FCP Capture Cards?

    Does Logic 9 support FCP video capture cards for audio in an out?
    I have a Blackmagic Decklink Extreme, analog ins/outs as well as digital AES/EBU
    Didn't have much luck with Logic 8 and the FCP cards so I used my Line 6 GuitarPort but it only has one 1/4" phono input.
    FutureX

    Hi FutureX,
    I would suggest you ask your question on the FCP forum if you don't get any reply here. Maybe you'll find someone there who can be of help. In any event, i doubt that buying an MBox with PT LE will meet your requirement for FCP capture cards, really!
    Apple won't respond to you here. That's not the place. This is a user forum. You could also call a production studio in your area and ask politely to a pro who's working with that stuff on a daily basis. I'm sure you can find someone. Good luck...

  • FCP importing SDHC media mono in stereo

    Hello !
    I've got a small issue. When importing files from SDHC card with video and two audio channels MONO, FCP in the monitor window, create a stereo file. I can't split them.
    This is annoying as generally I've got an interview on channel 1 and Camera microphone (noisy) on channel 2.
    How can I put them back in 2 separate mono channel ?
    Of course I can put the mono channel in the timeline and work like that but should have a solution to do it directly into the source window, no ?
    Thnaks !

    You can put it on the timeline, remove the stereo pairing (Option + L when it is selected on the timeline), delete the channel without audio, then double-click on the clip on the timeline to send it to the Viewer/Visualiseur to put your markers in and delete it from the timeline. Be sure to make a new master clip if you want to leave the project and return to it with the markers.
    Easier perhaps - at the end of the edit delete the audio layer with the on camera microphone, then use paste attributes to pan all of the audio channels to center. It would drive me crazy to do it this way because the audio will be messed up while you edit.

  • Capturing audio from soundcard!

    Can anybody help me? When i compile this code no problems appears, however when i execute the program this is shown to:
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    c:\Sun\SDK\jdk\bin>java JCapture
    javax.media.NotConfiguredError: setContentDescriptor cannot be called before con
    figured
    at com.sun.media.ProcessEngine.setContentDescriptor(ProcessEngine.java:3
    42)
    at com.sun.media.MediaProcessor.setContentDescriptor(MediaProcessor.java
    :123)
    at JCapture.doIt(JCapture.java:69)
    at JCapture.main(JCapture.java:27)
    Exception in thread "main" javax.media.NotConfiguredError: setContentDescriptor
    cannot be called before configured
    at com.sun.media.ProcessEngine.setContentDescriptor(ProcessEngine.java:3
    42)
    at com.sun.media.MediaProcessor.setContentDescriptor(MediaProcessor.java
    :123)
    at JCapture.doIt(JCapture.java:69)
    at JCapture.main(JCapture.java:27)
    The code is this:
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.util.Iterator;
    import java.util.Vector;
    import javax.media.CaptureDeviceInfo;
    import javax.media.CaptureDeviceManager;
    import javax.media.DataSink;
    import javax.media.Manager;
    import javax.media.MediaLocator;
    import javax.media.Processor;
    import javax.media.datasink.DataSinkEvent;
    import javax.media.datasink.DataSinkListener;
    import javax.media.datasink.EndOfStreamEvent;
    import javax.media.protocol.DataSource;
    import javax.media.protocol.FileTypeDescriptor;
    public class JCapture
    CaptureDeviceInfo captureDeviceInfo = null;
    DataSink dataSink = null;
    public static void main(String[] args)
    JCapture jCapture = new JCapture();
    jCapture.doIt();
    System.exit(0);
    private void doIt()
    // retrieve list of available capture devices
    Vector vector = CaptureDeviceManager.getDeviceList(null);
    Iterator it = vector.iterator();
    while(it.hasNext())
    CaptureDeviceInfo deviceInfo = (CaptureDeviceInfo)it.next();
    if("DirectSoundCapture".equals(deviceInfo.getName()))
    captureDeviceInfo = deviceInfo;
    break;
    // exit if no capture devices found
    if(captureDeviceInfo == null)
    System.err.println("No capture devices found!");
    System.exit(-1);
    try
    // get media locator from capture device
    MediaLocator mediaLocator = captureDeviceInfo.getLocator();
    // create processor
    Processor p = Manager.createProcessor(mediaLocator);
    // configure the processor
    p.configure();
    // set the content type
    p.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.WAVE));
    // realise the processor
    p.realize();
    // get the output of processor
    DataSource dataSource = p.getDataOutput();
    // create medialocator with output file
    MediaLocator dest = new MediaLocator("file://c:\\myFile.wav");
    // create datasink passing in output source and medialocator specifying our output file
    dataSink = Manager.createDataSink(dataSource,dest);
    // create dataSink listener
    dataSink.addDataSinkListener
    // anonymous inner class to handle DataSinkEvents
    new DataSinkListener()
    // if end of media, close data writer
    public void dataSinkUpdate(DataSinkEvent dataEvent)
    // if capturing stopped, close DataSink
    if(dataEvent instanceof EndOfStreamEvent)
    dataSink.close();
    // open the datasink
    dataSink.open();
    // start the datasink
    dataSink.start();
    // start the processor
    p.start();
    getConsolePress();
    // stop the processor
    p.stop();
    // close the processor
    p.close();
    catch(Exception e)
    e.printStackTrace();
    System.exit(-1);
    System.out.println("Finished!!");
    public void getConsolePress() throws Exception
    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader input = new BufferedReader(isr);
    String line;
    System.out.println("Press x to stop capturing...");
    while (!(line = input.readLine()).equals("x"))
    System.out.println("Press x to stop capturing...");
    return;
    }

    I compiled and ran your code and saw
    the error you described, but could not fix it ..
    OTOH - here is some code I was mucking
    about with recently (it was adapated from an
    example I found on a forum, but I cannot recall
    where), it seemed to work quite well, without
    ever creating a processor.
    Maybe that might help?
    import java.awt.FlowLayout;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JButton;
    import javax.swing.JOptionPane;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.InputStream;
    import java.io.FileOutputStream;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import javax.sound.sampled.AudioSystem;
    import javax.sound.sampled.AudioFormat;
    import javax.sound.sampled.AudioFileFormat;
    import javax.sound.sampled.AudioInputStream;
    import javax.sound.sampled.DataLine;
    import javax.sound.sampled.SourceDataLine;
    import javax.sound.sampled.TargetDataLine;
    public class AudioRecorder extends JFrame{
      boolean stopCapture = false;
      ByteArrayOutputStream byteArrayOutputStream;
      AudioFormat audioFormat;
      TargetDataLine targetDataLine;
      AudioInputStream audioInputStream;
      SourceDataLine sourceDataLine;
      File file;
    //  AudioFileFormat.Type fileType;
      /** The recorder will request enough memory for this lengh
      of time of audio recording.More might be possible.*/
      static int minutes = 4;
      /** channels - 1 for mono, 2 for stereo. */
      static int channels = 2;
      /** bytes - 1 means 8 bit, 2 means 16 bit, 3 means 24 bit. */
      static int bytes = 2;
      /** Samples per second, sample rate in Hertz. */
      static int samplerate = 44100;
      /** Default size of the audio array before expansion.
      Guarantees there is 'minutes' of memory for recording
      'bytes' of sound depth in 'channels' at 'samplerate'. */
      static int size = samplerate*channels*bytes*60*minutes;
      /** Make the temp buffer, for this fraction of a second. */
      static int timeperiod = 20;
      /** An arbitrary-size temporary holding
      buffer
      enough for 3 minutes of sampling in
      stereo at 16 bit, 44100Hz */
      //static byte tempBuffer[];
      static byte tempBuffer[] = new byte[samplerate*channels*bytes/timeperiod];
      public static void main(
        String args[]){
        if (args.length==0) {
          new AudioRecorder(null);
        } else {
          new AudioRecorder(args[0]);
      }//end main
      public AudioRecorder(String outputFileName){//constructor
        setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        setLocation(100,50);
        final JButton captureBtn =
          new JButton("Capture");
        final JButton stopBtn =
          new JButton("Stop");
        final JButton playBtn =
          new JButton("Save");
        captureBtn.setEnabled(true);
        stopBtn.setEnabled(false);
        playBtn.setEnabled(false);
        captureBtn.addActionListener(
          new ActionListener(){
            public void actionPerformed(
            ActionEvent e){
              captureBtn.setEnabled(false);
              stopBtn.setEnabled(true);
              playBtn.setEnabled(false);
              captureAudio();
        getContentPane().add(captureBtn);
        stopBtn.addActionListener(
          new ActionListener(){
            public void actionPerformed(
              ActionEvent e){
              captureBtn.setEnabled(true);
              stopBtn.setEnabled(false);
              playBtn.setEnabled(true);
              //Terminate the capturing of
              // input data from the
              // microphone.
              stopCapture = true;
            }//end actionPerformed
          }//end ActionListener
        );//end addActionListener()
        getContentPane().add(stopBtn);
        playBtn.addActionListener(
          new ActionListener(){
            public void actionPerformed(
              ActionEvent e){
              //Play back all of the data
              // that was saved during
              // capture.
              saveAudio();
            }//end actionPerformed
          }//end ActionListener
        );//end addActionListener()
        getContentPane().add(playBtn);
        getContentPane().setLayout(new FlowLayout());
        setTitle("IMAR");
        setDefaultCloseOperation(
          EXIT_ON_CLOSE);
        setSize(250,70);
        setVisible(true);
        if ( outputFileName==null ) {
          JFileChooser fc = new JFileChooser();
          int returnVal = fc.showSaveDialog(null);
          if(returnVal == JFileChooser.APPROVE_OPTION) {
            outputFileName = fc.getSelectedFile().toString();
          } else {
            outputFileName = "default.wav";
        file = new File(outputFileName);
        FileOutputStream fout;
        try {
          fout=new FileOutputStream(file);
        } catch (FileNotFoundException e1) {
          e1.printStackTrace();
      }//end constructor
      //This method captures audio input
      // from a microphone and saves it in
      // a ByteArrayOutputStream object.
      private void captureAudio(){
        try{
          //Get everything set up for
          // capture
          audioFormat = getAudioFormat();
    /*      AudioFormat.Encoding[] encodings =
            AudioSystem.getTargetEncodings(audioFormat);
          for(int ii=0; ii<encodings.length; ii++) {
            System.out.println( encodings[ii] );
          DataLine.Info dataLineInfo =
            new DataLine.Info(
              TargetDataLine.class, audioFormat);
          targetDataLine = (TargetDataLine)
            AudioSystem.getLine(dataLineInfo);
          targetDataLine.open(audioFormat);
          targetDataLine.start();
          System.out.println( "AR.cA: " + targetDataLine );
          audioInputStream = new
            AudioInputStream(targetDataLine);
          //Create a thread to capture the
          // microphone data and start it
          // running.It will run until
          // the Stop button is clicked.
          CaptureThread ct = new CaptureThread();
          Thread captureThread =
            new Thread(ct);
          captureThread.start();
        } catch (Exception e) {
          e.printStackTrace();
          System.exit(0);
        }//end catch
      }//end captureAudio method
      //This method plays back the audio
      // data that has been saved in the
      // ByteArrayOutputStream
      private void saveAudio() {
        try{
          //Get everything set up for
          // playback.
          //Get the previously-saved data
          // into a byte array object.
          byte audioData[] =
            byteArrayOutputStream.
            toByteArray();
          //Get an input stream on the
          // byte array containing the data
          InputStream byteArrayInputStream
            = new ByteArrayInputStream(audioData);
          AudioFormat audioFormat =
            getAudioFormat();
          AudioInputStream audioInputStreamTemp =
            new AudioInputStream(
              byteArrayInputStream,
              audioFormat,
              audioData.length/audioFormat.
                getFrameSize());
          audioInputStream =
            AudioSystem.getAudioInputStream(
              AudioFormat.Encoding.PCM_SIGNED,
              audioInputStreamTemp );
          DataLine.Info dataLineInfo =
            new DataLine.Info(
            SourceDataLine.class,
            audioFormat);
          sourceDataLine = (SourceDataLine)
            AudioSystem.getLine(dataLineInfo);
          sourceDataLine.open(audioFormat);
          sourceDataLine.start();
          //Create a thread to play back
          // the data and start it
          // running.It will run until
          // all the data has been played
          // back.
          Thread saveThread =
            new Thread(new SaveThread());
          saveThread.start();
        } catch (Exception e) {
          e.printStackTrace();
          System.exit(0);
        }//end catch
      }//end playAudio
      //This method creates and returns an
      // AudioFormat object for a given set
      // of format parameters.If these
      // parameters don't work well for
      // you, try some of the other
      // allowable parameter values, which
      // are shown in comments following
      // the declarations.
      private AudioFormat getAudioFormat(){
        float sampleRate = 44100.0F;
        //8000,11025,16000,22050,44100
        int sampleSizeInBits = channels*8;
        //8,16
    //    int channels = 2;
        //1,2
        boolean signed = true;
        //true,false
        boolean bigEndian = false;
        //true,false
        return new AudioFormat(
          sampleRate,
          sampleSizeInBits,
          channels,
          signed,
          bigEndian);
      }//end getAudioFormat
      //===================================//
      /** Inner class to capture data from
      microphone */
      class CaptureThread extends Thread{
        public void run(){
          byteArrayOutputStream =
             new ByteArrayOutputStream(size);
          stopCapture = false;
          try{//Loop until stopCapture is set
            // by another thread that
            // services the Stop button.
            while(!stopCapture){
              //Read data from the internal
              // buffer of the data line.
              int cnt = targetDataLine.read(
                tempBuffer,
                0,
                tempBuffer.length);
              if(cnt > 0){
                //Save data in output stream
                // object.
                byteArrayOutputStream.write(
                  tempBuffer, 0, cnt);
              }//end if
            }//end while
            byteArrayOutputStream.close();
          }catch (Exception e) {
            e.printStackTrace();
            System.exit(0);
          }//end catch
        }//end run
      }//end inner class CaptureThread
      /** Inner class to play back the data
      that was saved. */
      class SaveThread
        extends Thread {
        public void run(){
          try{
            if (AudioSystem.isFileTypeSupported(
              AudioFileFormat.Type.WAVE,
                audioInputStream)) {
              AudioSystem.write(audioInputStream,
                AudioFileFormat.Type.WAVE, file);
            JOptionPane.showMessageDialog(null,"Clip Saved!");
          } catch (Exception e) {
            e.printStackTrace();
            System.exit(0);
          }//end catch
        }//end run
      }//end inner class PlayThread
      //===================================//
    }//end outer class AudioCapture.java

Maybe you are looking for

  • Cannot send or receive email using Thunderbird, but can get it just fine on Verizon server.

    Every time Mozilla/Thunderbird does a major upgrade I have a problem with sending and receiving my email. When trying to send an email, I get the message: "An error occurred while sending mail. The mail server responded: 5.7.1 Missing or literal doma

  • EBS R12 RAC Clusterware Installation.

    Hi hussein/helios The Oracle support has installed a RAC on our EBS Prod server but it was a POC(proof of concept) only. So the name was TEST RAC instance. Now, we want to install the final config setup named PROD following the docs he made on the TE

  • Hi Question On Select-options

    Hi Experts,                       I am having  a following code where i kept  no intervals but there is extension part inside it u have ranges is it possible to deactivate that ranges option  in the extension part so that u can have only single value

  • How can i run my java Application stand alone?

    Dear all, As the topic i want to run my application in a single file without showing the dos prompt or type in the command in dos prompt by the user...... How can i do that, since in my application , i have used so other package? In fact i just want

  • Which Base MSI to Use For Adobe Reader Updates?

    I am new to creating AIP for Adobe Reader and am wondering which MSI to use as the base installer.  From what I understand, to create an AIP for Adobe Reader 11.0.07, I need to first have the AIP created for 11.0.00 and then patch it using the 11.0.0