PDA

View Full Version : Streaming with java


schar4
19th June 2002, 14:53
I'm builded a SwingApplet that displays last songs played and some statistics.

Now I want to add a button that connect to the stream and play my station through the applet, so I won't need winamp to listen to it. I think I can use the javax.sound.sampled class to do it (AudioInputStream...) but I don't know exactly how. I DL some free codes but they belong to complexes API and I don't know what is doing what and I can't get it to work.

Your solution would be strongly appreciate.

Bye everyone.

schar4
20th June 2002, 17:09
public Player(){
try{
m_audioInputStream = AudioSystem.getAudioInputStream( new URL ("http", "www.myURL.com", 8000, "") );
...

The program exit after that line, heres the error message :

javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input stream

I tried ... new URL("http", "www.myURL.com", 8000, "listen.pls"); and it's not working either.

please HELP ME

Gourou
20th June 2002, 21:50
I think that only gets a wave stream, not an mp3 stream