Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Play MP3 in jar file

 
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried the JMF MP3 plugin?
 
Fintan Conway
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fintan:

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

John.
 
Sheriff
Posts: 22208
117
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22208
117
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much for completely ignoring my post.
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22208
117
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And if that doesn't work you don't try the next suggestion? I certainly would.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic