Hello,
I am new to JMF and i am trying to do a voice chat application .I tried out a simple programme to capture and the voice and render it.The following is a part of the code code
-----------------------------------------------------------------
import javax.media.*;
import javax.media.rtp.*;
import java.net.*;
import java.util.*;
import java.io.*;
import javax.media.format.AudioFormat;
public class media3 implements ControllerListener
{
Processor pros;
public media3()
{
//*****finding a capture device to capture live audio
AudioFormat format=new AudioFormat(AudioFormat.LINEAR,8000,8,1);
Vector device=CaptureDeviceManager.getDeviceList(format);//getting the objects in an array i.e vectors
CaptureDeviceInfo di=null;
if(device.size()>0)
{
di=(CaptureDeviceInfo)device.elementAt(0);
}
else
{
//System.out.println("nothing");
System.exit(-1);//exit........if no capturedevice was found
}
//*****now we create a processor and show an error if we cannot create it
try
{
pros=Manager.createProcessor(di.getLocator());
}
catch(IOException ae)
{
System.exit(-1);
}
catch(NoProcessorException e)
{
System.exit(-1);
}
}
public void controllerUpdate(ControllerEvent evt)
{
}
public static void main (
String args[])
{
media3 pyr = new media3();
//System.out.println ("starting to play...");
}
}
-----------------------------------------------------------------
Now the code compiles properly,but it exits obviously telling that thereis no capture device now does that mean that i cannot do any capturing .do i need any extra software or hardware for doing so.I even want to do it for vdo.
Can anyone please help me.