Hello guys.

I'm wondering is it possible to stream mp3 songs from some site with java?
I tried to find something but allways everything what i found was only for reading mp3 songs from local disk.
If you know feel free to answer me.

- Regards, David.

Edited 4 Years Ago by MicroD: n/a

Hello guys.

I'm wondering is it possible to stream mp3 songs from some site with java?
I tried to find something but allways everything what i found was only for reading mp3 songs from local disk.
If you know feel free to answer me.

- Regards, David.

Hmm im not sure, may this be of help:http://www.exampledepot.com/egs/javax.sound.sampled/StreamAudio.html , maybe this:http://stackoverflow.com/questions/657921/how-to-stream-mp3-using-pure-java and this:http://stackoverflow.com/questions/343240/how-do-i-convert-an-audio-stream-to-mp3-using-java

Comments
Thanks for help

Finally i finished code. @cOrPuPtG3n3t!x i found something from there so thanks for links. Here is code for someone who need this:

package stream;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import javax.media.*;

import com.sun.media.codec.audio.mp3.JavaDecoder;

public class Aligner {

	static {
		JavaDecoder.main(new String[] {});
	}
	
	public static void main(String[] args) throws NoPlayerException, MalformedURLException, IOException  
	{
		Player player = Manager.createPlayer(new URL("/* URL of MP3 song */"));    
		player.start();
	}
}

PS. You will need Java MP3 PlugIn

Edited 4 Years Ago by MicroD: n/a

This question has already been answered. Start a new discussion instead.