Capture the microphone using CaptureDeviceManager not working, please help...
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Benny_keinan
Posted On:   Tuesday, August 6, 2002 04:22 AM

Hi

I need to record from my application to a file an audio file using the microphone. For some reason no matter what I am doing, the code:

			
CaptureDeviceManager.getDeviceList(new AudioFormat(AudioFormat.LINEAR));

keep returning an empty list. I have a microphone attached to the PC, I have recored using it with MicrosoftRecorder, but the capture device manager doesn't seems to locate it.


Any idea of what might be the problem?


Thanks,
Benny

Re: Capture the microphone using CaptureDeviceManager not working, please help...

Posted By:   khalid_hayat  
Posted On:   Wednesday, August 7, 2002 02:21 PM

Hi Benny

Plz try down the following stepss to perform the capture audio from microphone and stored to file.

1-

Find out the microphone CaptureDeviceInfo through


DataSource ds;
Vector audioDeviceList=new Vector();
CaptureDeviceInfo aCDI=null;
audioDeviceList=CaptureDeviceManager.getDeviceList(new AudioFormat("linear",44100,16,2));
aCDI=(CaptureDeviceInfo)audioDeviceList.firstElement();
System.out.println("aCDI : " + aCDI.getName());
ds=Manager.createDataSource(aCDI.getLocator());




2- Then create a processor from datasource and
then set the specific contenetType and set format of audio track as u wish.
3-Then passed this processor output to datasink object
and call open(),start() on datassink.




I think this step will solve your problem

About | Sitemap | Contact