This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Play MP3 in jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Play MP3 in jar file" Watch "Play MP3 in jar file" New topic
Author

Play MP3 in jar file

Fintan Conway
Ranch Hand

Joined: Apr 03, 2002
Posts: 141
Hi all,

I have an application that plays an MP3 song.

I have package the app into a jar, and included the MP3 song in the jar.

I would like the jarred app to pick up the MP3 song from the jar and play it from there, rather than having to include the MP3 file separately with the application. Is this possible?

I have found lots of ways to play "sampled audio" songs (wav, etc.) like this, but I cannot get it to work with an MP3 file.

I have also tried the following using the Java Media Framework (JMF), i.e. javax.media.* packages.


Any help would be greatly appreciated
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Have you tried the JMF MP3 plugin?


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Fintan Conway
Ranch Hand

Joined: Apr 03, 2002
Posts: 141
Wouter Oet wrote:Have you tried the JMF MP3 plugin?

Hi Wouter,

I have downloaded this and installed it. However I cannot find any documentation on how to use it within my code. Do you have any links/suggestions on how to code using this mp3plugin.jar?

Many thanks
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
Fintan:

Have you googled 'JMF javadoc'? I found information right away.

John.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

I've used BasicPlayer in a little demo console MP3 player application once. JLayer is also an often advised library.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Fintan Conway
Ranch Hand

Joined: Apr 03, 2002
Posts: 141
John de Michele wrote:Fintan:

Have you googled 'JMF javadoc'? I found information right away.

John.

Hi John,

I have tried this. Unfortunately there is no information on how to programmatically play an MP3 file, using either JMF or the MP3 plugin. I could find no javadocs for the mp3 plugin.

Could you post links to where you found sample code / javadocs for coding to play MP3 files please?

Many thanks,

Fintan
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Thank you so much for completely ignoring my post.
Bert Wilkinson
Ranch Hand

Joined: Oct 28, 2009
Posts: 33
Rob Prime wrote:Thank you so much for completely ignoring my post.


Lighten up.... He's trying the first idea presented.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

And if that doesn't work you don't try the next suggestion? I certainly would.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Play MP3 in jar file
 
Similar Threads
JMF: Stream video over UDP
Largish wav files
Playing video's according schedule
Getting resource from jarfile
retrieving the information stored in the properties of an audio/video file