This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

How to Play Streaming mp3 File  RSS feed

 
Greenhorn
Posts: 10
Java Java ME MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to play mp3 file from remote server. Can anyone help me ?
 
Sheriff
Posts: 21747
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JLayer allows you to create a Player (or AdvancedPlayer) from an InputStream. That should work. Other MP3 playing libraries may have similar optionality.
However, keep in mind that if the connection is slow, the player will either have to pause regularly or perhaps even throw an exception. Perhaps you'd like to add some form of buffering in yourself if you encounter any problems.
 
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaFX 2.0 also supports MP3 playback.
http://docs.oracle.com/javafx/2.0/media/overview.htm#sthref4

edit: and the next page http://docs.oracle.com/javafx/2.0/media/simpleplayer.htm
 
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!