Getting echo when capturing audio with JMF

Hello.
I have just downloaded JMF 2.1.1 and have cribbed one of the examples to produce an application that will capture audio input, process it and pass it straight to the speakers. However, I am getting echo, i.e. the input signal appears twice at the speakers, shifted by about half a second.
Now, before you tell me that it is due to feedback from the speakers to the microphone, I must tell you that my audio signal is from a radio plugged into the mike socket of my PC, so there is no chance of any external feedback.
Below is the code:
import javax.media.*;
import javax.media.protocol.*;
import javax.media.control.*;
import javax.media.format.*;
public class ExampleClass2 implements ControllerListener {
     private Object waitSync = new Object();
private boolean stateTransitionOK = true;
     private Processor proc;
     public ExampleClass2 () {
          MediaLocator locator = getLocatorByName ("JavaSound audio capture");
          try {
               proc = Manager.createProcessor(locator);
               proc.addControllerListener(this);
               proc.configure();
               waitForState (Processor.Configured);
               proc.setContentDescriptor(null);
               proc.start();
//               waitForState(Processor.Started);
//          proc.getGainControl().setMute(true);
          } catch (Exception ex) {
               ex.printStackTrace();
               System.exit(1);
* Block until the processor has transitioned to the given state.
* Return false if the transition failed.
boolean waitForState(int state) {
     synchronized (waitSync) {
     try {
          while (proc.getState() != state && stateTransitionOK)
          waitSync.wait();
     } catch (Exception e) {}
     return stateTransitionOK;
* Controller Listener.
public void controllerUpdate(ControllerEvent evt) {
     if (evt instanceof ConfigureCompleteEvent ||
     evt instanceof RealizeCompleteEvent ||
     evt instanceof PrefetchCompleteEvent) {
     synchronized (waitSync) {
          stateTransitionOK = true;
          waitSync.notifyAll();
     } else if (evt instanceof ResourceUnavailableEvent) {
     synchronized (waitSync) {
          stateTransitionOK = false;
          waitSync.notifyAll();
     } else if (evt instanceof EndOfMediaEvent) {
     proc.close();
     System.exit(0);
     public static void main (String [] args) {
          ExampleClass2 two = new ExampleClass2();
Now, the really interesting thing is that if I uncomment the lines that mute the processor, I get only a single signal out of the speakers. It appears as if there is some connection between the mike input and speaker output.
Just to make sure, I tried this with JMStudio and got the same result. When I captured input, I got two signals output until I pressed the mute button, when I got one signal.
I also get the same problem if I use a Player, rather than a Processor.
I am running on Win95, JDK1.3.
Any thoughts?

i'm having the same problem. but i tried with teh audio property settings. and get resolved. wat solution u found? i would like to know how u solved your problem, plz let me know very soon.
Thanks,
Parth Pandya
Hello.
I have just downloaded JMF 2.1.1 and have cribbed one
of the examples to produce an application that will
capture audio input, process it and pass it straight
to the speakers. However, I am getting echo, i.e. the
input signal appears twice at the speakers, shifted by
about half a second.
Now, before you tell me that it is due to feedback
from the speakers to the microphone, I must tell you
that my audio signal is from a radio plugged into the
mike socket of my PC, so there is no chance of any
external feedback.
Below is the code:
import javax.media.*;
import javax.media.protocol.*;
import javax.media.control.*;
import javax.media.format.*;
public class ExampleClass2 implements
ControllerListener {
     private Object waitSync = new Object();
private boolean stateTransitionOK =
ansitionOK = true;
     private Processor proc;
     public ExampleClass2 () {
MediaLocator locator = getLocatorByName ("JavaSound
d audio capture");
          try {
               proc = Manager.createProcessor(locator);
               proc.addControllerListener(this);
               proc.configure();
               waitForState (Processor.Configured);
               proc.setContentDescriptor(null);
               proc.start();
//               waitForState(Processor.Started);
//          proc.getGainControl().setMute(true);
          } catch (Exception ex) {
               ex.printStackTrace();
               System.exit(1);
* Block until the processor has transitioned to
d to the given state.
* Return false if the transition failed.
boolean waitForState(int state) {
     synchronized (waitSync) {
     try {
while (proc.getState() != state &&
& stateTransitionOK)
          waitSync.wait();
     } catch (Exception e) {}
     return stateTransitionOK;
* Controller Listener.
public void controllerUpdate(ControllerEvent evt)
vt) {
     if (evt instanceof ConfigureCompleteEvent ||
     evt instanceof RealizeCompleteEvent ||
     evt instanceof PrefetchCompleteEvent) {
     synchronized (waitSync) {
          stateTransitionOK = true;
          waitSync.notifyAll();
} else if (evt instanceof ResourceUnavailableEvent)
     synchronized (waitSync) {
          stateTransitionOK = false;
          waitSync.notifyAll();
     } else if (evt instanceof EndOfMediaEvent) {
     proc.close();
     System.exit(0);
     public static void main (String [] args) {
          ExampleClass2 two = new ExampleClass2();
Now, the really interesting thing is that if I
uncomment the lines that mute the processor, I get
only a single signal out of the speakers. It appears
as if there is some connection between the mike input
and speaker output.
Just to make sure, I tried this with JMStudio and got
the same result. When I captured input, I got two
signals output until I pressed the mute button, when I
got one signal.
I also get the same problem if I use a Player, rather
than a Processor.
I am running on Win95, JDK1.3.
Any thoughts?

Similar Messages

  • IT's possibile capture audio with JMF on Pocket Pc

    It's possibile capture audio with JMF cross-platform version on Pocket Pc?? Or how can it possibile on Pocket pc?????

    This article say about MMAPI and MIDP, I need a solution about JMF because, my application must capture audio on Pocket Pc with Jeode VM, and Jeode VM is compliant with JDK1.1.8(it's subset).

  • Capturing Audio with JMF

    Howdy, folks.
    Relative JMF newbie, here. I'm trying to write an app to capture audio from my sound card. Got the basics done, now I want to add some fancy stuff. Specifically, I'd like to show a display of the waveform.
    Now, when I create a datasink, I need to provide the processor (where the data comes from) and the medialocator (where the data goes to). The only way I know to build a medialocator is to give it a URL or a string for a file name. Is it possible to put the actual byte data directly into a buffered reader or something so I can translate it into a graphic waveform or do I have to write it to disk, and then read it back?
    Thanks for any help,
    Russ

    did you find any solution??
    please let me know thanks.
    [email protected]

  • How do I save photos that have been synced to my Ipad2, so that they do not get deleted when I sync with a different photo file on my computer.

    How do I save photos that have been synced to my Ipad2, so that they do not get deleted when I sync with a different photo foder on my computer (Pc win7).

    Place that first folder of photos that you synced to the iPad within the main folder of photos that you sync from and select them to sync again. You can place any number of subfolders within the main folder that you sync from and select those folders to sync. Just "tick"(select) the folders in the photos tab in iTunes.
    iOS and iPod: Syncing photos using iTunes

  • Capturing audio using jmf from web start

    Hi everybody,
    Currently im working on a project related with audio capturing in client side. Clients will access the application from web start. jmf will be used to capture audio. Additionally, i dont want users to install jmf.
    At first, for testing purposes i wrote a small and simple program that only captures audio and plays it again. It works fine as a standalone application. However, it did not work if i deploy the same program on the web start, doing all required configurations carefully for web start deployment.
    I found the problem is that required capture devices could not be detected when the program is run from web start.
    I searched forums and internet and made some trials to solve and idendify the problem. i want to share you the results:
    At first , i installed jmf to my machine, some jars (jmf.jar, sound.jar,...) and a jmf.properties file are extracted to a directory in my machine. Then, after copying jmf.jar and jmf.properties file to some folder, i uninstalled jmf. Then i created a simple project for testing purposes that captures audio and plays it back.i created this project from eclipse IDE and and set its classbath to the folder which contains only jmf.jar and jmf.properties. It runs successfully. However, if i remove jmf.properties from this file, project does not run, no device can be found. I strongly think, this means that, this jmf.properties file is necessary to detect any audio capture device and hence to run any jmf program that captures auido.
    If i deployed the same project from web start, it did not work as i mentioned, since no audio device can be found because of the lack of jmf.properties file. However, if i install jmf again, since the jmf.properties is created, the project runs from web start too. The interesting thing is that, if i uninstall jmf
    but only create the directory that only contains jmf.properties again, project still runs from web start. If i remove this file from that directory projects does not run again.
    It seems that, this jmf.properties file is impornt for detecting audio capturer devices. It is created in the phase of jmf installation by jmfregistry or jmfinit and is unique for the machine.
    Finally, i conclude that in order to run any project that captures auido from web start without installing jmf, a jmf.properties file should be created for each client machine automatically (in a silent way) before execution which means that jmfregistry or jmfinit should be run silently before execution to create this jmf.properties. Is there anybody that knows antying to  achieve this ?
    Any suggestions about the topic rather than the answer to the specific question above will also be appreciated greatly. Thanks a lot in advance.

    Hi
    I am working on a similar requirement. Please let me know if you have a solution.
    Thanks in advance.

  • Capture audio with PDAs

    Hi,
    I'm developing an application for PDAs and Smartphones in which I have to integrate a voice recorder, so I'm working with MMAPI 1.1 . With the emulator the application works but on the HP iPAQ 5450 I get the error message "unsupported protocol" when I try to create the Player with "capture://audio" as parameter. I'm using the J9 virtual machine from IBM, and I have installed all the correct updates which refers to MMAPI.
    By reading on this forums I've known about applications like this on Nokia 60's series device.
    Is there anyone who has developed applications like this for other devices (especially PDAs)?
    On which device it works ?
    Thanks.

    GerrySA wrote:
    Is there anything like this when I am playing the guitar or singing through a mic and want to capture audio?
    -- Gerry
    Yes...
    Well, almost
    If you keep "Punch On The Fly" enabled, Logic is actually ALWAYS recording, although once you hit stop, that buffer is cleared.
    So the trick to this is, if you are playing along (guitar or voice), and you realize you should have recorded that take, simply hit RECORD, BEFORE you stop. You can then "peel back" the audio region (drag the left side of that short region you'll have when stopping what you were playing to hit the record button), and drag it to the LEFT. You'll see all the audio you were playing there.

  • Final Cut Express won't capture audio with the video anymore, why?

    I have used Final Cut Express 4 for over a year now with no problems, but recently I am unable to capture any audio with the video from my camera. I can do it through iMovie no problem. I can't figure out if I changed a setting by accident because everything looks normal to me. Could another program be interfering with this? Quicktime Pro? I have no idea how to fix this.

    First of all, we need a bunch of information in order to help. Please provide the specs of the footage and the sequence you are using. Also, are you using DV, HDV, or AVCHD? Do you hear audio when the clip is played in the viewer, or is there no audio at all once the clip is captured/ingested?

  • Getting RTSP servers to work with JMF

    I have read through many postings about this, but none of them have been answered. Has anyone gotten JMStudio or any other JMF application to be able to properly recieve video streams in any format from a video on demand server using RTSP? I have tried Darwin Streaming Server (which the JMF faq claims has been tested with JMF, so I take it someone out there knows how to get this working) and Real's Helix Universal Server Basic. I have tried using JMStudio's Open URL menu, and writing a simple application to act as a client.
    At this point I would just like to find some server that works with some file/encoding format. Has anyone gotten anything to work? Thank you.
    -Brad

    I am facing the same problem. does anyone succeed to write a java RTSP player that interfaces well with Darwin Streaming Server?
    I don't find any examples of MPEG1 streaming in JMF. Most samples i.e. SimplePlayerApplet.java (param="sun.avi") use local video paths but not rtsp:// URLs.
    Samples like AVreceive.java / RTPUtil.java do not use explicit MPEG1 samples and assume that you have an RTP server. And other apps like http://www.alphaworks.ibm.com/tech/mpeg-4 are not fully open source.
    What streaming server would you suggest to use? I tried without success to stream a video within a java applet using DarwinSS (ok with .mov, .mp4 but not in java) or RealServers (ok with .rm but also not in java).
    In http://java.sun.com/products/java-media/jmf/2.1.1/support-rtp.html it is said that the following RTP servers are compatible with the JMF RTP Player (using javax.media.rtp) but each of them have a serious drawback:
    ShowMeTV Transmitter (commercial), IP/TV Server (commercial), vic (Video only), vat/rat (Audio only).
    Thanks in advance for any reply

  • My 7th gen ipod nano has an echo when reading audio books

    My 7th generation ipod nano has an echo when listening to audio books. How do I fix this?

    Hi ipoduser2013-,
    Welcome to Apple Support Communities.
    I'd first try to reset the iPod:
    Reset iPod nano
    http://www.apple.com/support/ipodnano/assistant/itunes/#section_4
    Cheers,
    Jeremy

  • Capture Audio with Ctl-*?

    Sometimes, in play mode I have been playing along on the keyboard, conclude and then realize that I did was not in record mode.
    A find that if I stop, issue the Ctl-* (numpad) that it will capture what is in the play buffer and slap it in to the sequence at hand.  Saved!
    Is there anything like this when I am playing the guitar or singing through a mic and want to capture audio?
    -- Gerry

    GerrySA wrote:
    Is there anything like this when I am playing the guitar or singing through a mic and want to capture audio?
    -- Gerry
    Yes...
    Well, almost
    If you keep "Punch On The Fly" enabled, Logic is actually ALWAYS recording, although once you hit stop, that buffer is cleared.
    So the trick to this is, if you are playing along (guitar or voice), and you realize you should have recorded that take, simply hit RECORD, BEFORE you stop. You can then "peel back" the audio region (drag the left side of that short region you'll have when stopping what you were playing to hit the record button), and drag it to the LEFT. You'll see all the audio you were playing there.

  • Only getting one channel of audio with mic HELP

    I had been using Garageband with the built in mic to do my podcasts. I just got some real gear.
    Here is what I got... M Audio USB fast track, MXL V63MBP running on 10.3.9
    I am only getting one channel of audio through the mic. I have the settings on the mixer right and I have gone in the sound preferences and made sure it was right.
    On the track in garageband, I made sure that the real instrument settings were set to Stereo. I have been messing around with this thing for an HOUR and I am still only getting one channel of audio. I've done everything I've been able to come up with in google and still nothing works. If anyone has any ideas ,that would be swell because I'm beginning to think that the crappy built in mic on my mac is looking really good about now.

    You're welcome.
    The common confusion is that 'Stereo" means two speakers and "mono" means one. Stereo actually means two different signals going to the two speakers. Since a Mic is a mono input device, you set the track to mono so that the same sound comes out of both speakers. Enjoy --Hang

  • Crash 0::42 when Exporting Audio with Quicktime:

    Hello Folks,
    We're having an issue with exporting .mov files from After Effects.  When a user tries rendering a project through Make Movie > Ouput Module > Quicktime Movie, AE crashes with the error code 0::42 if the user simply clicks the 'Format Options' button for Audio output.  In addition, if the user selects File > Export > Quicktime Movie, the movie will get about half way done and crash with the same error.
    This error occurs on all of our workstations.  We are using CS4 and HP workstations of various makes and models, the only direct similarity is they all use Realtek built in audio.  I have done some troubleshooting using procmon.exe and the issue that seems to be coming up points to a conflict with our audio driver and Quicktime (see the following regesty entries below)
    The following kept coming up with a BUFFER OVERFLOW and NAME NOT FOUND results:
    HKLM\System\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Enum\HDAUDIO\FUNC_01&VEN_10EC&DEV_0262&SUBSYS_103C 130A&REV_1002\4&705ED8E&0&0001\DirectSound\Device Presence
    HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32
    Also, both registry entries point to the file
    C:\Program Files\Adobe\Adobe After Effects CS4\Support Files\(Media Core plug-ins)\Common\AsioWdm.dll
    Does AsioWdm.dll have some conflict with our HD Realtek audio and quicktime?
    I tried uninstalling and reinstalling the Sound card drivers / codecs.  This actually allowed me to export Quicktime movies without crashing via File > Export.  However, we're still experiencing the crash when clicking on 'Format Options' from Make Movie > Output Module > Format Options.
    Does anyone have any idea what's causing / how to resolve our issue?
    Any help would be much appreciated.
    Thanks,
    Ben

    Hello again,
    Thank you for your responses, here is an update on our status:
    I am testing a simple scene with a .wav file.  AE only crashes when we're using the Quicktime module and if we click on Format Options in the audio settings.  All other modules seem to work just fine.  Interestingly, if we choose File > Export > Quicktime Movie, we can access the audio compression options and AE does not crash.
    In regards to ASIO, as far as I know, we are not interfacing with anything else.  The workstations we're using have built-in speakers, but I don't see how that could be an issue and nothing else is plugged in.
    As for the codecs, we have the k-lite package installed as well as DivX, Xvid and whatever comes with the Realtek drivers.  I tried uninstalling k-lite and xvid, but neither seemed to help.
    Other things I have tried:
    - Uninstalled and reinstalled AE
    - Updated Quicktime to the newest version
    - Uninstalled and reinstalled Quicktime to version 7.65
    - Disabled openGL support
    NOTE: we recently tried this on one of our workstations (z600) with windows 7 64 bit and we got the same issue.
    No matter what we do, AE still crashes when we have the Quicktime format selected and click the Format Options Button for the audio settings.
    Any other ideas?

  • Cant get FCP5 to "capture now" with HD

    I am currently headed to NY tomorrow and need some feedback asap. I am trying to capture live streaming video with the "capture now" button. I am going to be capturing on a 1.5 GhZ powerbook with 512mb of ram. We are using the Sony HVR-Z1U HDV camcorder. So when we try testing the capture it simply starts to capture but only for a few seconds and gives this message. "Capture now has reached the end of the tape.All exsisting footage between the point where you started the capture and the end of the tape was captured successfully." We continue to get this message but need to capture live using HD down converting to DV. These will be hour long interviews and multiple interviews.
    If anyone can please let me know how to get FinalCut Pro 5 to capture and not stop with that message it would be greatly appreciated. Thank you in advance guys and gals.
    -Richard

    You need a firewire drive to be the capture disk. Do not capture to the System disk.
    Set a capture time limit in the Capture Now settings. Set it longer than the anticipated interview to give you some wigggle room if needed.
    Make sure the battery is charged in the Powerbook
    You need more ram.
    Don't forget to run tape as a back-up.
    x

  • Trouble with detectin IDS Eagle capture device with JMF

    Hi
    I'm having trouble detecting my capture card (IDS Eagle model). Is anyone else having the same problem? I tried using the JMStudio tool but the only capture devices detected are the audio ones.
    I have installed the WDM driver for this card but jmf doesn't detect it.
    Any help will be appreciated. Thank yoU!

    Hello Tania,
    I think if you look at the source code for AVTransmit2.java, which can be downloaded, this will help you. Make sure you use javasound://8000 as one of the parameters when creating the AVTransmit2 object.
    Regards,
    James

  • No Audio with JMF

    I encoded some video using virtualdub. I haven't been able to find any audio settings that result in audio playing back properly. I've looking at the supported formats, and I've tried plenty of different settings. Does anyone have any information about how to encode an avi file to work in jmf?
    Thanks

    Ok, fixed mine. Go to Library/QuickTime: Remove obsolete QuickTime Components: FFusion, Xvid Delegate, 3ivX, DivX, DivX Decoder, XviD, msmpeg4v1, msmpeg4v2, AviImporter, EX_M4S2, Casio AVI Importer, AC3 Codec, Sorenson and MatroskaQT.
    Maybe try one at a time starting with 3ivX
    I'm using Perian 1.2.3
    All working now.

Maybe you are looking for

  • How to install the JDI  and what re the prerequisites

    Hi All, Anybody tell me , AS iam new to the SAP NetWeaver How to install the JDI, I have got one document in  sdn . It has given the prerequisite as. Complete installation of DI (CMS, DTR, and CBS) on SAP J2EE Engine Should i install all the above co

  • Import mailboxes

    Yosemite 10.10.1(14B25) Mail 8.1(1993) Previous OS was 10.8.5. I'm trying to import my Mailboxes stored in timemachine backup. Open Mail Browse TimeMachine disk to /Latest/HD/Users/me/Library/Mail/V2/Mailboxes Tried to import them all in one go first

  • New MacBook Pro Wifi Problem Wap2

    i have a problem with a new penryn macbook pro where it will not join my network if its in wap2 security mode and it will join no problem under wap mode, what is the issue here? anyone else experiencing this problem? I know i can live with Wap mode b

  • How do you change the colour of the text box?

    A lot of the text box options seem different for DC. Is there a way to change the colour of the text box that you create/the borders etc.? In the past, you would just press Ctrl+E and a toolbar would pop up so that you could fiddle w/ the colour of t

  • HT3702 Will not accept credit card security verification number....why?

    Had to restart my device....and reinstall all content.....for some reason iTunes account settings will not accept the security verification number on my MasterCard....???