UseMP3SoundDecoder()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Quin
Addict
Addict
Posts: 1122
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

UseMP3SoundDecoder()

Post by Quin »

Title pretty much sums this one up, I'd like an audio decoder for MP3, similar to OGG and FLAC.
User avatar
idle
Always Here
Always Here
Posts: 5835
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: UseMP3SoundDecoder()

Post by idle »

+1 I think miniaudio supports mp3 so shouldn't be a biggy
infratec
Always Here
Always Here
Posts: 7576
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: UseMP3SoundDecoder()

Post 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.
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: UseMP3SoundDecoder()

Post 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 :-)
Last edited by jamirokwai on Mon Apr 28, 2025 3:25 pm, edited 1 time in total.
Regards,
JamiroKwai
Quin
Addict
Addict
Posts: 1122
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: UseMP3SoundDecoder()

Post 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
nsstudios
Enthusiast
Enthusiast
Posts: 309
Joined: Wed Aug 28, 2019 1:01 pm
Location: Serbia
Contact:

Re: UseMP3SoundDecoder()

Post 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.
User avatar
NicTheQuick
Addict
Addict
Posts: 1503
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: UseMP3SoundDecoder()

Post 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.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
Shardik
Addict
Addict
Posts: 2058
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: UseMP3SoundDecoder()

Post 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.
BarryG
Addict
Addict
Posts: 4122
Joined: Thu Apr 18, 2019 8:17 am

Re: UseMP3SoundDecoder()

Post 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?
User avatar
NicTheQuick
Addict
Addict
Posts: 1503
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: UseMP3SoundDecoder()

Post 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
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: UseMP3SoundDecoder()

Post 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.
Regards,
JamiroKwai
Quin
Addict
Addict
Posts: 1122
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: UseMP3SoundDecoder()

Post 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.
Post Reply