1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| public MP3Streamer(String rtpaddress, String filepath)
{
mediaLocator = new MediaLocator(rtpaddress);
System.out.println("-> Created media locator: '" +
mediaLocator + "'");
try
{
URL url;
url = new URL("http://127.0.0.1/austinpowers.wav");
DataSource source = Manager.createDataSource(
new MediaLocator(url)); // Hang ici !
System.out.println("-> Created data source: '" +
url + "'");
// set the data source.
setDataSource(source);
System.out.println("-> Set the data source on the transmitter");
// start the processor
mediaProcessor.start();
// open and start the data sink
dataSink.open();
dataSink.start();
}
catch (Exception e)
{ // Exceptions, tout ça... } |
Partager