Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Play MP3 in jar file

 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried the JMF MP3 plugin?
 
Fintan Conway
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fintan:

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

John.
 
Sheriff
Posts: 21972
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've used BasicPlayer in a little demo console MP3 player application once. JLayer is also an often advised library.
 
Fintan Conway
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 21972
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much for completely ignoring my post.
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Prime wrote:Thank you so much for completely ignoring my post.



Lighten up.... He's trying the first idea presented.
 
Rob Spoor
Sheriff
Posts: 21972
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And if that doesn't work you don't try the next suggestion? I certainly would.
 
    Bookmark Topic Watch Topic
  • New Topic