Recover audio signal to analyse them with JMF

Hello,
I'm a french student in informatics in Paris.
(Sorry for my poor english...)
We're developping an audio player in JAVA for our end study project with a friend. This player will contain a graphics plugin to "show" music in real time (like the graphics plugin of winamp or media player).
We are using the Java Media Frameworks API to develope this player. We succeed to read a song, but we don't manage to get audio signal to analyse them. In fact, we want to get audio spectrum in real time, so we have to get audio signal with the intention of analyse it with Fourier tools.
Did you got an idea of the way to do this?
Maybe we could re-implements the Player interface of the jmf API, rather than use the Manager.createPlayer method? (actually I also don't really understand how work the Manager.createPlayer() method. And how implements Player interface, when we don't really know what to put in the methods?...).
Thanks a lot for your help.
Thomas

Hi Thomas,
what you want to do is possible with JMF.... but beware that sometimes Java will prove slower than what you expect.... I don't know if this is the correct way to do it, but you can get the samples by creating a class that implements the Effect interface (see sun GainEffect).
In the process(Buffer inputBuffer, Buffer outputBuffer) method you have the inputBuffer that contains the sampled audio (in 2 channels, odd and even bytes or words depending on your 8/16 bit preferences).
You can use this data to compute your FTT animaton... You must then create a 'chain' that will include your processor (again see sun examples, the function assignEffect).
If you want to be very JMF-complant, you should also implement some other interface to return you 'visual' component that display your graphic animation (probably the right method is the getControlComponent in the Control interface).
Ok then...I hope this will prove helpful and to see your effects as soon as possible :-)
Bye
Marco

Similar Messages

  • Recovering audio signal from PCM stream

    Hi i want to recover an audio signal from a PCM stream which is being transmitted by a third party  system  on RS 422 wires. the only information i have about the PCM stream is
    sampling freq              16kHz
    bits                                 8
    quantization tech          u Law qunatization
    over all PCM data transmmison vlaue mentioned  is 2.408 M bits
    please suggest me if it is doable or not . further more suggest the proper NI hardware as  well as software modules required to achive this. will NI 9401 do this job

    Tirmizi,
    I think it may be possible.  You could not use a 9401 but if you had a USB to RS-422 converter you could probably read the PCM data into LabVIEW using VISA functions.
    If you can successfully import your data to LabVIEW, I found a similar forum post that explains the functions in LabVIEW to use to create a .wav file and what you can do with it:
    http://forums.ni.com/t5/LabVIEW/Raw-PCM-to-WAV/m-p​/2739674
    Hope this helps!
    Jon F.
    Applications Engineer
    National Instruments

  • Bug Report: Audio Signal breaks off, chopped, muted, not playing, stop, cut

    This behaviour happens very seldom and by chance, so I had this once with a Space Designer Reverb and now it's happening with a Softsynth. Please listen to this short mp3:
    http://www.diedacon.de/piano_cut.mp3
    The first piano exactly plays how it is intended: Over the complete length. now i copy this midi block in the arrange window behind it. and another piece again behind the next one. the last two ones play shorter though it is the same lenght!
    keep in mind: no automation, any sent midi data commands or sysex behaviour, no overlapping (midi data length is set manually shorter than it's "shell") of audio or midi data is interfering to create this "phenomenon".
    For the example of the Space Designer Reverb: Imagine an Audio signal flowing through a Space Designer, which creates a tail of reverb. Now think of the audio signal on this channel completely dissappearing for 1 second at the middle part - it seems, if someone just has chopped some piece out of the audio signal: the reverb continues with it's natural fade out to the end.
    same "keep in mind" criteria for the space designer.
    Anyone else experiancing "audio cutting", "muting" or "stopping midi data"? This is definately some kind of strange bug.
      Mac OS X (10.3.8)  
      Mac OS X (10.3.8)  
      Mac OS X (10.3.8)  

    Well, unless you're using Steinberg 'The Grand' as your softsynth piano it's probably no bug but sth else. Does it happen in solo mode, too ?
    ( For troubleshooting, it always makes sense to list your audio equipment / drivers and your macs specs in your profile; or at least within your posting, so people have the chance to be helpful. In short : more details, please ... )

  • Can anyone help me with this- recording at audio signal in the upper frequency region of the audio s

    Using Audition, how would I go about recording an audio signal (voice) at
    14,500Hz? I know this would be outside the frequency range for the human ear to hear, but that is the point of my question. Any help would be very much appreciated
    Thanks!!!!

    You are thinking about it absolutely the wrong way if you think you can "convert" a voice file to be only 14.5kHz. You need to think of a control frequency (14.5kHz) being modulated by the voice line you record. You can't just change the pitch of the voice file or use the FFT filter to eliminate everything under 14.5kHz. It won't work that way.
    Try it yourself. Record a voice line. Use Pitch Shifter or pitch strech to change the pitch on the voice. Crank it up all the way to highest possible pitch. Listen to it. Painful isn't it? Could you understand anything? Thought not. Then go to the FFT filter. Reset so it's flat. Add a break point (click on the line) at 14.5kHz. Then click and drag the line below 14.5kHz and bring it to zero. Listen to it. You get the occasional movment if you watch the Frequency Analysis window, but certainly nothing audible to my burned out ears.
    The direction I would look at is using the Vocoder effect in MT. insert your voice line into the MT window. In EV, create a new file using Generate Tones at 14.5kHz of the length you need. Insert the tone file into MT ABOVE the voice file. Select and highlight them both. Still in MT, go to Effects>Vocoder. Make your Control Wave the voice file and your Process Wave the tone file. Hit OK. A new file (that looks blank) will be created. Play it in EV with the Frequency Analysis window open and you will see activity at 14.5kHz. This is amplitude modulation (AM). Will it result in anything subliminal? I doubt it, but it would depend on how much you belive subliminal messaging works.
    Didn't an earlier version of Audition have some subliminal effect? Could it have been as far back as CEP 1.2?

  • 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?

  • How can I play music on my macbook pro (OSX Lion) through a Pioneer receiver. I've connected them with a mini display port to HDMI cable with audio support bought at the Apple Store, but there's no sound coming through. thanks

    How can I play music on my macbook pro (OSX Lion) through a Pioneer receiver? I've connected them with a mini display port to HDMI cable with audio support bought at the Apple Store, but there's no sound coming through. There are 4 HDMI-in ports on the receiver - BD, DVD, DVR/BDR and audio. In my system preferences for sound, the receiver doesn't show up as an output option. Can anyone please advise. (ps, this is my first time posting a question, so I hope I can find your answers!) thanks, JP downunder

    For sound, try the audio output port and connecting to the RCA  audio input ports on your Pioneer receiver.  Use something like this:
    http://eshop.macsales.com/item/OWC/PODCONNECTOR/
    Ciao.

  • Can you tell me how to measure audio signal frequency in measurement studio with visual basic 6.0?

    I'd like to measure two differential input signal(I.e. A+ and A-),below is two test projects,
    1.connect A+/A- to PCI 6052E card's ACH0/ACH8 ,and refer to GND for testing
    2.connect respectively A+/A- to PCI 6052E card's ACH0/ACH8 for testing
    Could you tell me the details of the second project?and give me a illustration in measurement studio with visual basic 6. 0 about the second?
    In addition,I would like to measure the audio signal frequency,could you give me a illustration in measurement studio with visual basic 6.0?
    Wait for your reply!

    Dear kelven,
    Thank you for contacting National Instruments.
    To address your question, there are Analog Input shipping examples that demonstrate how to measure an analog input differentially, as you specify in (2).
    As for measuring the audio signal frequency, you may want to check out the following KnowledgeBase. The link is:
    http://digital.ni.com/public.nsf/websearch/4b08380530d72d3b86256340004c3005
    Let me know if you have any further questions or if this does not resolve your issue.
    Thanks again and have a great day!
    Chad AE
    Applications Engineer - National Instruments

  • Help needed with getting Audio signal through to Mac Book Pro (using Logic 9 & Behringer Xenyx 1204USB mixer)

    Ok so I am sure I have everything set up correctly,
    Logic has recognised and is using the mixer, I have sound coming through the headphones when I put in a drum sample onto audio track, no signal going in from audio using the first channel. Audio channel is set up with correct inputs & outputs. USB setting used on mixer......phantom tried on and off with the condenser mic I am using.....still no luck not even changing from mi to guitar. No signal when recording audio...... AAAHHH HELP! Racking my brains!
    Thank you in advance

    Kudos to figuring it out yourself.
    Yes, Logic is geared to the professional user, you will need to set up the program to your particular way of working, Logic was well developed for professional use long before Apple purchased it, it's not an Apple program per se. It's complex and offers a myriad number of choices so that it can be configured to many styles of working, there's often 3 or 4 ways to perform the same function.
    Logic insists the user educate themselves... which is a good thing.
    Here ya go! 
    http://documentation.apple.com/en/logicpro/
    "Exploring Logic Pro" is a good one to start with.
    Also in the main manual... "Setting Up Your System"

  • An error on a site deleted a photobucket folder full of pictures for a class and I'm trying to see if since I last veiwed them with firefox theres a way to recover them-With the cache or something?

    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    An error on a site deleted a photobucket folder full of pictures for a class and I'm trying to see if since I last veiwed them with firefox there is a way to recover them-With the cache or something?
    == This happened
    ==
    Just once or twice
    == I was on photobucket around 6pm on Mon July 19th
    ==
    == Firefox version
    ==
    3.5.9
    == Operating system
    ==
    Windows XP
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9
    == Plugins installed
    ==
    *-The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
    *Shockwave Flash 10.0 r42
    *My Web Search Plugin Stub for 32-bit Windows
    *Default Plug-in
    *Adobe PDF Plug-In For Firefox and Netscape
    *DivX Web Player version 1.4.3.4
    *npdnu
    *Office Plugin for Netscape Navigator
    *iTunes Detector Plug-in
    *GEPlugin
    *4.0.50524.0
    *MSN® Toolbar
    *Google Updater pluginhttp://pack.google.com/
    *RealJukebox Netscape Plugin
    *RealPlayer(tm) LiveConnect-Enabled Plug-In
    *6.0.12.69
    *Google Update
    *Java Plug-in 1.4.2_03 for Netscape Navigator (DLL Helper)

    Hi- I'm Sarie and no this didn't help. I actually tried to log in to respond and it said I wasn't registered. Not really all that cool.

  • I have imported videos to my lap top (Windows Vista), from my new ipad.  Quick time plays them with audio, however the screen is black. What is the fix?

    I have imported videos to my lap top (Windows Vista), from my new ipad.  QuickT
    ime plays them with audio, however the screen is black. What is the fix?

    Experimental advice (in this particular context) coming up.
    Open your QuickTime control panel (either via the Control panels, or by going "Edit > Preferences > QuickTime Preferences" in the Quicktime Player). In the Advanced tab, uncheck Enable Direct3D video acceleration:
    ... and click OK. Quit and restart the QuickTime Player prior to checking to see if the settings change has had any effect.

  • 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).

  • Is it possible to send and recieve audio signal with AI / AO in NI-6229 which is DAQ board.

    I'd like to test MP3 Player.
    The procedure is below.
    1. Send a audio signal of 1kHz from mp3 file in PC through AO in NI-6229.
    2. Record it with MP3 player.
    3. Play a recorded audio signal with MP3 player.
    4. Recieve the signal through AI in NI-6229 and measure frequency and voltage of the signal.
    5. Compare the signal with original signal.
    Do you think it is possible?

    Hello Blue Sky80,
    It is possible to measure audio signals using LabVIEW and Sound an Vibration toolset.  Please take a look at this Developer Zone article on Audio measurements using LabVIEW to get more information on this subject.I hope this helps!
    Regards,
    Ima
    Applications Engineer
    National Instruments
    LabVIEW Introduction Course - Six Hours
    Getting Started with NI-DAQmx

  • Does MacBook Air A1370 provide us with a USB audio signal?

    I am a user of  an 11-inch MacBook Air A1370 with OS X 1.7.5. To my mac, I want to connect my USB audio device, GoVibe XVert that converts USB audio signal to S/PDIF signal either of coaxial or light. The "radio" in The iTune on my mac shows me the BBC 3 station. What I want to do is to apply the BBC digital music signal direct to my  pure digital power amplifier by connecting the converter to the amplifier. But I failed. No sound from the speakers at all even the very converter works for a Windows 7 PC.
    Is my usage wrong while Mac outputs a USB audio signal?  Or, the Macs of my type provide no USB audio signal as its specification?
    Please help me.

    The problem was solved. Just select a device  for sound output from "Internal Speakers" to "Ti USB audio" that is the converter.

  • Play audio file with jmf on linux?

    a simple audio player as flow:
    import javax.media.*;
    import java.io.File;
    import java.net.URL;
    public class SimpleAudioPlayer {
        private Player audioPlayer = null;
        public SimpleAudioPlayer(URL url) throws Exception {
            audioPlayer = Manager.createRealizedPlayer(url);
        public SimpleAudioPlayer(File file) throws Exception {
            this(file.toURL());
        public void play() {
            audioPlayer.start();
        public void stop() {
            audioPlayer.close();
        public static void main(String[] args) throws Exception {
            File file = new File("/usr/local/download/1.wav");
            SimpleAudioPlayer sap = new SimpleAudioPlayer(file);
            sap.play();
    }when run the program
    javac -cp jmf.jar SimpleAudioPlayer.java
    java -cp .:jmf.jar SimpleAudioPlayer
    the output as flow:
    Unable to handle format: ima4/ms, 8000.0 Hz, 4-bit, Mono, Unsigned, 4027.0 frame rate, FrameSize=4096 bits
    Failed to prefetch: com.sun.media.PlaybackEngine@defa1a
    Error: Unable to prefetch com.sun.media.PlaybackEngine@defa1a
    How can I play wav file with jmf on linux?(OS is debian5 and jmf cross-platform pack)

    thanks for your reply.
    I tried to replace the wav file "1.wav" with the linear encoded WAV download from pscode.org,and run the code again,but
    BasicTrackControl:prefetchTrack():96 1 bm = com.sun.media.BasicRendererModule@1186fab
    BasicRendererModule.doPrefetch:155 Render : true
    Render buffer size: 32768
    BasicRenderModule.doPrefetch:159
    javax.media.ResourceUnavailableException: Cannot intialize audio device for playback
    at com.sun.media.renderer.audio.JavaSoundRenderer.open(JavaSoundRenderer.java:93)
    at com.sun.media.BasicRendererModule.doPrefetch(BasicRendererModule.java:158)
    at com.sun.media.BasicTrackControl.prefetchTrack(BasicTrackControl.java:99)
    at com.sun.media.PlaybackEngine.doPrefetch1(PlaybackEngine.java:682)
    at com.sun.media.PlaybackEngine.doPrefetch(PlaybackEngine.java:658)
    at com.sun.media.PrefetchWorkThread.process(BasicController.java:1430)
    !!!!!!!§§§§§§§§§§§ BasicTrackControl:prefetchTrack():96
    at com.sun.media.StateTransitionWorkThread.run(BasicController.java:1339)
    Unable to handle format: LINEAR, 16000.0 Hz, 16-bit, Mono, LittleEndian, Signed, 32000.0 frame rate, FrameSize=16 bits
    Failed to prefetch: com.sun.media.PlaybackEngine@26e431
    Error: Unable to prefetch com.sun.media.PlaybackEngine@26e431

  • How to correct "An incompatible audio signal" with Apple TV and HD signal

    I have an Apple tv2(mc572Ll/a) running version 4.4.4 of the software, connecting to an older Sharp Aquos LCD-26d6u TVvia a regular HDMI cable.
    I used to be able to watch a rented movie until my onsitel technician/ teenager adjusted something.
    Now when the preview plays the sound works. When a video is displayed using AirPlay from the iPhone the sound works.
    But when the HD movie plays the message "an incompatible audio signal has been received. Check the output device settings" and there is no sound.
    When I connect this to a newer HDTV the movie sound works.
    Any suggestions on what Apple tv or tv settings to use to get the sound back (other than upgrading my technician/teenager/tv)?

    Thanks!  I changed the Dolby setting from On to Auto, and the sound started working for Netflix TV shows.  Before I was getting the message:
         Incompatible audio format received check output device settings
    and there was no sound. 
    The Settings are accessed through Apple TV.   When you have Apple TV on, and you see all the colored rectangles for Netflix, huluplus, HBO etc., (which can be accessed by repeatedly hitting the Menu button on the remote), the top row shows:
       Movies   TV Shows  Music  Computers  Settings
    Use the 4 way controller to choose Settings, then press the button in the center of the 4 way controller to select Settings.  Then select Audio Video.  Then scroll down to Dolby Digital.  When you are on Dolby Digital and you push the button in the center of the 4 way controller, the setting will change.  I changed the Dolby Digital setting to Auto.

Maybe you are looking for

  • Using Skype from Multiple Devices - Keeping them i...

    I use my skype account from many different devices as I travel. Can I "force" an update to make sure I've received updates or reflect sends from other devices (esp. IM & SMS) to the device I'm on at the moment?  I'm kinda tired of my iPhone grabbing

  • ITunes will quit working mid-song and will skip around entire library.

    In the most recent iTunes version running on windows 7, iTunes will not play through an entire song and skips around the entire library of music. Sometimes only the first few seconds of a song will play, and sometimes a little over a minute will play

  • Getting around commiting at task to hardware in DAQmx and maintaining HW timing when switching between two AI tasks.

    I have a project that requires two HW timed AI task that are triggered at different rising edges. I originally started with an example vi that has HW timed retriggerable AI that seemed to working fine until I decided to capture two channel with a sep

  • Encore WT8-A vs. Encore 2 WT8-B

    June 16, Toshiba Japan released a Standard Edition of the dynabook tab S38 (overseas model Encore 2 WT8-B), having USB2.0, 32/64GB eMMC, 2GB RAM (a single channel), GPS and gyroscopes and Bluetooth; Changes: the weight is reduced to 385g (estimated a

  • Cataloging option missing: By date!

    Hi, I have used LR only for a little while and find the program fantastic! I returned from a trip with 13,000 21Mpx RAW files and LR has helped me manage these huge assets with ease. Now, I found that one option is really missing. There are several c