Page 1 of 1

UseMP3SoundDecoder()

Posted: Sun Apr 27, 2025 9:56 pm
by Quin
Title pretty much sums this one up, I'd like an audio decoder for MP3, similar to OGG and FLAC.

Re: UseMP3SoundDecoder()

Posted: Sun Apr 27, 2025 10:16 pm
by idle
+1 I think miniaudio supports mp3 so shouldn't be a biggy

Re: UseMP3SoundDecoder()

Posted: Mon Apr 28, 2025 12:08 pm
by infratec
I don't know if you know, that ...

you can use the movie library to play mp3.

Use the example of the movie library and choose a mp3 file.

Re: UseMP3SoundDecoder()

Posted: Mon Apr 28, 2025 1:01 pm
by jamirokwai
+1

Would be great to have this one. @infratec: A few years ago I coded my own music player. With the movie library you have to check for MP3, FLAC or OGG for every file and use the appropriate command. UseMP3SoundDecoder() would have some advantages in this field :-)

Re: UseMP3SoundDecoder()

Posted: Mon Apr 28, 2025 2:58 pm
by Quin
infratec wrote: Mon Apr 28, 2025 12:08 pm I don't know if you know, that ...

you can use the movie library to play mp3.

Use the example of the movie library and choose a mp3 file.

That is hellarious, thanks for sharing! I did not know that. native MP3 decoder command would still be much nicer :D

Re: UseMP3SoundDecoder()

Posted: Tue Apr 29, 2025 10:07 am
by nsstudios
+1
There was a problem with Miniaudio's auto-codec selection when mp3 was enabled that made file loading slower.
GitHub issue
But this might have been fixed since.

Re: UseMP3SoundDecoder()

Posted: Tue Apr 29, 2025 10:25 am
by NicTheQuick
Quin wrote: Mon Apr 28, 2025 2:58 pm ... native MP3 decoder command would still be much nicer :D
I don't think this will ever happen because MP3 decoder/encoder has a proprietary license and I don't think Fantaisie Software will pay for that to be included in the Purebasic installation.

Re: UseMP3SoundDecoder()

Posted: Tue Apr 29, 2025 10:58 am
by Shardik
NicTheQuick wrote: Tue Apr 29, 2025 10:25 am
Quin wrote: Mon Apr 28, 2025 2:58 pm ... native MP3 decoder command would still be much nicer :D
I don't think this will ever happen because MP3 decoder/encoder has a proprietary license and I don't think Fantaisie Software will pay for that to be included in the Purebasic installation.
https://en.wikipedia.org/wiki/MP3 wrote:The basic MP3 decoding and encoding technology is patent-free in the European Union, all patents having expired there by 2012 at the latest. In the United States, the technology became substantially patent-free on 16 April 2017 (see below). MP3 patents expired in the US between 2007 and 2017.

Re: UseMP3SoundDecoder()

Posted: Tue Apr 29, 2025 11:19 am
by BarryG
Quin wrote: Mon Apr 28, 2025 2:58 pmnative MP3 decoder command would still be much nicer
But the Movie lib is native. Why add another library that does the same thing?

Re: UseMP3SoundDecoder()

Posted: Tue Apr 29, 2025 12:02 pm
by NicTheQuick
Shardik wrote: Tue Apr 29, 2025 10:58 am
https://en.wikipedia.org/wiki/MP3 wrote:The basic MP3 decoding and encoding technology is patent-free in the European Union, all patents having expired there by 2012 at the latest. In the United States, the technology became substantially patent-free on 16 April 2017 (see below). MP3 patents expired in the US between 2007 and 2017.
Thank you. Now I realize again how old I am. :D

Re: UseMP3SoundDecoder()

Posted: Tue Apr 29, 2025 12:04 pm
by jamirokwai
BarryG wrote: Tue Apr 29, 2025 11:19 am
Quin wrote: Mon Apr 28, 2025 2:58 pmnative MP3 decoder command would still be much nicer
But the Movie lib is native. Why add another library that does the same thing?
MP3-decoding is already a part of Miniaudio. I think, Purebasic should have separate libs for movies and audio. Playing mp3 with the movie library is more like a workaround... On MacOS, my player also plays aac and such, but that should be implemented into the audio-library as well.

Re: UseMP3SoundDecoder()

Posted: Tue Apr 29, 2025 2:12 pm
by Quin
BarryG wrote: Tue Apr 29, 2025 11:19 am
Quin wrote: Mon Apr 28, 2025 2:58 pmnative MP3 decoder command would still be much nicer
But the Movie lib is native. Why add another library that does the same thing?
Situation: I'm building a media player. I want it to be able to play all the formats PB supports, so I go and look at the sound documentation. Wav, ogg, and flac. Cool. Little do I know that I secretly can play MP3, with a library that I'm entirely uninterested in for my application.
MP3 playing belongs in the sound library IMO, especially because I'm pretty sure miniaudio offers this, although the dr_mp3 decoder is slightly weird from what I recall.