Possible Duplicate:
How to stream mp3 using pure Java
I have URL, example http://mysite.ru/1.mp3. I need play this song in开发者_JAVA技巧 desktop.
How to do this?
I know that this question asked many times, but I was not able to find the answer. How to use the library?
update:
I need example
One way would be to download it to a temporary File
and use Desktop.open(File)
.
Java Media Framework can play mp3 files, however, I've never used it with remote files.
If you are interested in pure Java solution then Java Media Framework can help. But if you need to install JMF Mp3 plugin
Using JMF available at http://www.oracle.com/technetwork/java/javase/download-137625.html, have you tried it:
private Player player = Manager.createPlayer(new URL("http://mysite.ru/1.mp3"));
player.start();
?
精彩评论