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]
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).
-
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? -
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. -
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?
-
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. -
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?
-- GerryGerrySA 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. -
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?
ThanksOk, 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. -
How can capture audio with labview
I desired to make a audio equalizer vi using lab view. Audio will be taken from microphone. How can I capture sound from microphone with labview?
See the example "Sound Card AutoPower Spectrum" This allows you to sample from an input device through your sound card, and take a spectrum. you should be able to bin the spectrum by frequency bands, and show the histogram of frequencies. You probably can even selectively resample and scale the frequencies, mix the signal and output the new sounds but I hav not tried this (I am not an audiophile so this is beyond my scope of expertise) Good luck ,
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA -
Capture audio with microphone and save to disk
Hello,
I would like to know if there is any way to record audio from
user's output? Let's say I capture it using its microphone, and I
want to create an audio file with it, or a swf file or whatever
file it is. I need to save that audio for further playback. Can
someone point me in any direction!? I have been surfing on this
topic but I didn't find anything, apparently it can't be done, but
I would love otherwise.
Thank you,
JCAYes that's the way it could work. FMS is designed for
streaming audio, video and data around keeping things synchronised
in real time, but it can save the streams to be played back later
as well.
It would be an expensive solution if that's all you want to
do.... there is an open source 'version' in development... called
red5, but I think you need to know how to program in java, although
I'm not sure.
Or you could look at adobe connect/formerly macromedia breeze
- It prebuilt and is a pay for use service, but does much more than
what you're looking for. I'm pretty sure you can custom logo it
etc. You might want to try the free trial account and check it
out. -
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 -
Captivate capture audio with screen?
I intendo to create a presentation about Adobe Audition and I
would like to
know id captivate captures the audio in the same time that
capture the
screen.
Thanks
[ ]'s
RenatoHi Renato
If you are asking if Captivate can record system sounds, the
answer is that it cannot. At least, not without a workaround.
Captivate can record voice narration at the time of
recording. One way to capture system audio during the recording
process is to insert a small patch cable that runs between the
Speaker out jack and the Microphone in (or Line In) jack and record
away. Or you could also acquire and attach a mixing device to
accomplish this.
Cheers... Rick -
Hi,
I make a test capturing audio with jmf , the problem that i have a delay for playing this capture (delay is 1 s). but with the JMSTUDIO test it work without delay
I can remove this delay or no ?
thanks for all.Well gosh, I have no idea what your code is doing so I have no idea what to tell you...
-
Capture cards to use with JMF....
Hello, I need to buy a video capture card to use with JMF in order to get a video signal and send it using a stream channel.
Somebody can help me and post a list of compatible capture cards with JMF?.
I think on buy a PINNACLE 500 PCI but i have read that it is incompatible with JMF.
Thanks.Creative webcam live should work, most webcams will work... at least under Windows. I've 2 older creative webcams that work under Windows.
Not sure about Linux support though...
Ps. there's a Java Media Framework section of this forum, where all the JMF related questions should be posted.
regards,
Owen -
How to render audio with sample rate 48000hz using jmf
hi,
In my application i need to play the audio with jmf player with sampling rate 48000hz. but i found that jmf player plays the audio with sampling rate of 44100hz only.but my application needs to play the audio with sampling rate of 48000hz .please help me how to do this using jmf .
thanks in advance,hi,
In my application i need to play the audio with jmf player with sampling rate 48000hz. but i found that jmf player plays the audio with sampling rate of 44100hz only.but my application needs to play the audio with sampling rate of 48000hz .please help me how to do this using jmf .
thanks in advance,
Maybe you are looking for
-
Function module EPS_GET_DIRECTORY_LISTING not in background
Dear Experts I am using FM 'EPS_GET_DIRECTORY_LISTING ' to get the list of files in application server directory. The FM worked very well for a few days. However, from last week it is throwing an expection "READ_DIRECTORY_FAILED" although there ain't
-
My iPod touch 5 doesn't show up in my itunes
my iPod touch 5th gen doesn't show up in my iTunes when i plug it into my computer. i am using an original apple cable
-
Need directions on how to open MUVO
I have this really anoying headphones jack problem on my Muvo TX. the player's still under waranty but I li've far from the place where I bought it so there's no way for me to send it back. anyway, what i need from you guys is directions on how to op
-
Hi, I have noticed a balance in Trade payables account for Dummy profit center in this report even after executing transaction '1KEK - Transferring Payables/Receivables ' and moreover if I click to check the actual line items the message is 'no value
-
I was at the airport in Atlanta and could not connect to the public wifi. I chose that one and the next page had no other info or entry...help!