0

I've been looking and reading in some old posts how to convert mp3 stream from URL and play it through Java. my application is currently playing an audio from my PC, but I want to run a radio from streaming link. You know that many of the radio streams are MP3... :( I've seen a lot of posts for JMF (Java Media Framework), but i find it only in the Oracle site. Is it a non-free library? I'm running IntelliJ on mac and it will be great if you help me to find out how to run my app with mp3 Stream.

Jonas
  • 121,568
  • 97
  • 310
  • 388
maxxxdj
  • 27
  • 8
  • From what I heard it is easier to use JavaFX to play MP3, for instance like in https://stackoverflow.com/a/24347793 (you will need to download JavaFX though as it is no longer part of standard Java). – Pshemo Feb 28 '21 at 14:36
  • maybe converting the mp3 to Java Sound API stream – maxxxdj Feb 28 '21 at 15:28
  • I would like to implement an online radio player with Swing & Java with playing that stream. – maxxxdj Feb 28 '21 at 19:42
  • I may be wrong but from what I remember there should be a way of mixing Swing and JavaFX, so it may be possible to make GUI with Swing and at the same time having JavaFX thread which will handle playing music (but I would probably try doing it only in JavaFX - note that its `Media` should be able to read online data like when you specify it like `new Media("https://some.server.com/path/to/data.mp3");`). – Pshemo Feb 28 '21 at 19:50
  • "i find it only in the Oracle site. Is it a non-free library?": what do you mean by that?? if you find the download you download it!! I have jmf on my computer! I dont know if it works on Mac. As for javax.sound, first try to play an .mp3 local on your machine. I think I was succesful in playing radio - if you check my answrrs back back. But a lot of radio is now AAC!!!! watch out for that!! Any way you have a lot of work to Do. – gpasch Feb 28 '21 at 23:08

0 Answers0