Capture Audio with JMF
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Philippe_Godin
Posted On:   Saturday, April 28, 2001 12:02 PM

Good Day, I'm trying to capture audio from a microphone using JMF. My problem is that I can't get the microphone device using sun's example. This is what they have: Vector deviceList = CaptureDeviceManager.getDeviceList(new AudioFormat("linear", 44100, 16, 2)); if (deviceList.size() > 0) di = (CaptureDeviceInfo)deviceList.firstElement(); else // Exit if we can't find a device that does linear, 44100Hz, 16 bit, // stereo audio. System.exit(-1); // Create a Player for the capture device: try{ Player p = Manager.createPlayer(di.getLocator()); } catch (IOException e) { } catch (NoPlayerException e) {} The thing is that the getDe   More>>

Good Day,
I'm trying to capture audio from a microphone using JMF. My problem is that I can't get the microphone device using sun's example. This is what they have:
Vector deviceList = CaptureDeviceManager.getDeviceList(new
AudioFormat("linear", 44100, 16, 2));
if (deviceList.size() > 0)
di = (CaptureDeviceInfo)deviceList.firstElement();
else
// Exit if we can't find a device that does linear, 44100Hz, 16 bit,
// stereo audio.
System.exit(-1);

// Create a Player for the capture device:
try{
Player p = Manager.createPlayer(di.getLocator());
} catch (IOException e) {
} catch (NoPlayerException e) {}

The thing is that the getDeviceList methid doesn't take an AudioFormat as a parameter...
The tutorial also says that using the method without any parameters returns the complete list. That is not true, that method is not defined for ().

Does anyone did this before and can help me get my microphone device to work

TIA Flip

   <<Less

Re: Capture Audio with JMF

Posted By:   Kamaljeet_Madan  
Posted On:   Thursday, May 17, 2001 10:06 PM

Hi!
Yes , the problem u r facing is common,
and the solution is that u have to first register ur microphone with the JMF registry, so that JMF knows which is ur capture device and where is it located,
for this run the JMFRegistry at command prompt
: >java JMFRegistry

and then select the capture devices tab,
do auto detect ,
and now run ur code,
at this point it should run fine
hope this will solve ur prob
About | Sitemap | Contact