• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to play mp3 files from a java program?  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanted to build an mp3 player as a Java project. One crucial part of the project involves being able to play an mp3 fie. I am not able to find the right api(if one exists) and am not able to find a suitable answer when searching on the web.

Can someone give me a simple code snippet illustrating the playing of mp3 file using Java program.
Also, I am using Eclipse IDE and please tell me how to import files if any importing of files is required.
 
Ranch Hand
Posts: 445
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

You would need to use JMF for this.
Google should give you all relevant info.
 
Saloon Keeper
Posts: 3330
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found this a couple of years ago. Works for '.wav' files but I don't see why it wouldn't work for '.mp3' files.

 
Ranch Hand
Posts: 159
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the API of javafx.scene.media.AudioClip
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!