Fehler beim Streamen

martinkores

Grünschnabel
Ich hab ein Programm geschrieben, dass das Mic einlesesn und streamen soll. Aber das funktioniert irgendwie nicht so richtig:

Kann mir bitte irgendwer sagen, wo hier der Fehler liegt?:

public class CaptureTest
{
public CaptureTest() { }

public static void main(String[] args)
{
CaptureDeviceInfo di = null;
Processor p = null;
StateHelper sh = null;

Vector deviceList=CaptureDeviceManager.getDeviceList(new AudioFormat (AudioFormat.LINEAR, 44100, 16, 2));

if (deviceList.size() > 0)
{
di = (CaptureDeviceInfo)deviceList.firstElement();
}
else
{
System.out.println("Can't find linear play device.\n");
}

try
{
p = Manager.createProcessor(di.getLocator());
sh = new StateHelper(p);
}catch (Exception e)
{
System.out.println(e.getMessage());
}
if (!sh.configure(10000))
{
System.out.println("Unable to configure processor.\n");
}

p.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.WAVE));

//Try to realize the processor.
if (!sh.realize(10000))
{
System.out.println("Can’t realize processor.\n");
}

DataSource source = p.getDataOutput();

try{

String url= "rtp://10.1.11.111:49150/audio";
MediaLocator m = new MediaLocator(url);
System.out.println ("Searching Datasink");
DataSink d = Manager.createDataSink(source, m);

d.open();
System.out.println ("Datasink opened");
d.start();
// Capture audio from microphone for 10 seconds.
sh.playToEndOfMedia(10000);
System.out.println ("started!");
} catch (Exception e) {
System.out.println (e);
}
sh.close();
}
}

Hier wird folgender Fehler ausgegeben:

Searching Datasink
javax.media.NoDataSinkException: Cannot find a DataSink for: com.sun.media.multiplexer.BasicMux$BasicMuxDataSource@b02efa

Danke schonmal
 
Zurück