MP3 Decoder Question

BlitzMax Forums/BlitzMax Programming/MP3 Decoder Question

Ked(Posted 2008) [#1]
How does Audacity have a MP3 decoder when you are supposed to pay for one? Is it because Audacity is a freeware program?

Thanks,


Brucey(Posted 2008) [#2]
irrKlang, FMOD and BASS all have mp3 decoding available. However, if you want to sell something that uses it, you'll probably want to get yourself a license first :-)


grable(Posted 2008) [#3]
The legality of open source MP3 is sortof in a gray area.
Youl find more info on wikipedia than this forum ;)
http://en.wikipedia.org/wiki/MP3


Ked(Posted 2008) [#4]
Is it possible to get a BMX module for MP3 loading? I am trying to make a simple music mp3 player on my computer like I did with BlitzPlus. It will just be for me and maybe the other computers here at my house, so I won't be selling it.

Thanks, Brucey, for your response. :)

EDIT: OK, I will read that site.


Ked(Posted 2008) [#5]
Additionally, patent holders declined to enforce license fees on free and open source decoders...

So does that mean it would be alright to make a free bmx module?


xlsior(Posted 2008) [#6]
So does that mean it would be alright to make a free bmx module?


Possibly, although that would mean that any program you create that uses it would also need to be free...


REDi(Posted 2008) [#7]
MaxMod has MP3 loading and streaming for windows using the Microsoft ACM (Audio Compression Manager), but the next release will include new MP3 decoding supplied by LibMad (cross platform)


Ked(Posted 2008) [#8]
I tried out MaxMod just now and it loads the MP3's really slowly. Will LibMad load them faster?


Brucey(Posted 2008) [#9]
How slow is "really slowly" ?


Ked(Posted 2008) [#10]
How slow is "really slowly" ?

As slow as BRL.OGGLOADER.

I noticed that CreateAudioStream() loads them instantly. Are there any draw-backs to using CreateAudioStream() instead of LoadSound() and LoadAudioSample()? (ie. skipping (since it is being streamed)) Will I be able to select where--in the music--to start playing it? Like, Windows Media Player has a little music track bar at the bottom.


Brucey(Posted 2008) [#11]
LoadSound probably does what its name suggests. Loads the whole mp3 into memory, uncompressed, just like the ogg loader does.

Streaming is where you want to be for no-delay playing.


Ked(Posted 2008) [#12]
What about this though: http://www.blitzbasic.com/Community/posts.php?topic=75850#847814


Brucey(Posted 2008) [#13]
I don't know about MaxMod or LibMad for jumping to points in the audio. REDi should be able to answer that for you.

irrKlang, FMOD and BASS I know support setting the positions in tracks tho.


Ked(Posted 2008) [#14]
Are irrKlang, FMOD, and BASS available for download? I can't find them.


Brucey(Posted 2008) [#15]
Not officially yet... (although you can get them via SVN)... finishing off some of the APIs and documentation still.
However, they are perfectly usable as they stand - just need to get them up to my standards for release... I'm a bit nit-picky.


Ked(Posted 2008) [#16]
Cool. What is the SVN's url?


Brucey(Posted 2008) [#17]
Head for http://maxmods.googlecode.com/

and then to the Source tab, and follow the directions.
Be careful about getting everything from there tho... there's a lot of it, so just pick what you need ;-)

Oh, and if you want to use the Audio-driver modules (those that allow you to use irrKlang etc as a Max Audio Driver), you'll also need to get the latest BRL.Audio from the BlitzMax SVN.


Ked(Posted 2008) [#18]
Ok, thanks!


REDi(Posted 2008) [#19]
The current release of MaxMod doesnt do stream seeking, but the next release does (some way off yet tho).

TBH Bruceys BASS/FMOD modules are always the best solution if you're not going to be selling your product or if the license fees are not an issue.


Retimer(Posted 2008) [#20]
Could you not just sell your software without mp3 capability, but allow the customer to create a plugin themselves for it? (*hint* such as a friend), then have them release the plugin as a 3rd party plugin?

It would then be able to support mp3, but mp3 would not be supported or provided by you, cheating avoiding the license fees, no?

Just a thought...scam the scammers.


Brucey(Posted 2008) [#21]
irrKlang, FMOD and BASS work by default without mp3 support. But, when you drop the appropriate dll in the folder, that dll is loaded when the app starts and you get mp3 functionality, kind of like what Retimer describes about not shipping the app with mp3 support directly ;-)


REDi(Posted 2008) [#22]
Really mp3 licensing isnt as expensive as people think, for games you dont need a license until you've sold 5000 units, then you'll need to get a US$2500 license, which covers for the life of the title, so 2500/5000=$0.50 per unit (about GB £0.30p)

Why the likes of FMOD and BASS would pull them sort of tricks is beyond me, considering the amount they charge for a license.


Brucey(Posted 2008) [#23]
They aren't pulling tricks... the mp3 support is just option "plugins" in the form of dlls. Whether you choose to include those dlls is entirely up to you, and subsequently the need to seek out a license also rests on your shoulders.

Seems perfectly reasonable. :-)


Ked(Posted 2008) [#24]
@REDi:

If you could, could you make a small MaxGUI example of an MP3 music player using maxmod's mp3 streaming? I've been trying to do this for six hours and it is not working at all. I would GREATLY appreciate it if this could be done for me.

Thanks,


REDi(Posted 2008) [#25]

This version of maxmod is really only designed for use in games, so if you want position sliders and such you'd be better off using FMOD, or wait forever for the next version of maxmod ;) (which is much more flexible)

Just out of interest, what problems where you having getting it to work?

NOTE: MP3 support is only available on windows in the current release of maxmod.


Ked(Posted 2008) [#26]
Just out of interest, what problems where you having getting it to work?

I'm having a problem streaming songs using the same pointer (music:tchannel) right after each other.

I will look more closely at your example tomorrow.
Thanks!


Ked(Posted 2008) [#27]
I built and ran your example, started streaming a song, started streaming another song, and it gave me the same error as I've been getting: "Unhandled Exception Error" on WaitEvent()


REDi(Posted 2008) [#28]
Dodgy, I dont get that here, whats your system spec?

If you fancy helping me figure out whats going on, could you edit the mod files "audiostream.mod/audiostream.bmx" and "mp3.mod/mp3.bmx" to comment out the "NoDebug" lines at the top of each file, then rebuild the modules and run it in debug mode. This should then point out where the error is coming from instead of throwing a UEE.


Ked(Posted 2008) [#29]
Windows XP Home SP3

I commented out the "NoDebug" lines at the the top of each file and I got the same error. "Unhandled Exception Error: Attempt to access field or method of null object" on WaitEvent()


REDi(Posted 2008) [#30]
Thanks for trying mate, does this only happen with MP3 files? could you try it with OGG/MOD file (just trying to narrow it down a bit) also could you try the OpenAL driver to see it that has the same problem.


Ked(Posted 2008) [#31]
I tried Directsound and OpenAL with MP3 files and I get the same error.
I tried Directsound and OpenAL with OGG files and it works.
I tried Directsound and OpenAL with an OGG file then went to MP3 it works.
I tried Directsound and OpenAL with an MP3 file then went to OGG it works.

:D

So to answer your question--because I didn't--Yes, it only happens with MP3 files. ;)


REDi(Posted 2008) [#32]
Interesting, thanks mate, I'll have a good look and see if I can figure something out.


REDi(Posted 2008) [#33]
I cant reproduce this error at all, I just played ~20 MP3s in a row and nothing, is it perhaps a particular file/s thats causing it?


Retimer(Posted 2008) [#34]
Did you try compiling the modules without gui app selected? I've read a couple times that having it checked can cause issues with modules, I may be wrong.


Ked(Posted 2008) [#35]
REDi, what version of MaxGUI are you using and are you using your "dev" version of maxmod or the one from your sig? Oh, and I'm using the SVN version of the BRL.Audio module.

Retimer, I don't compile modules through the IDE because the IDE compiles all of them instead of the one(s) I want.


REDi(Posted 2008) [#36]
I'm using the SVN versions of MaxGUI and BRL.Audio, and I reinstalled the MaxMod in my sig to test this for ya.

I'll have another play around with this tonite.


Ked(Posted 2008) [#37]
Ok. I re-downloaded the SVN version of MaxGUI and I reinstalled MaxMod from your sig and I am now getting a more "reasonable" error instead of it going out on WaitEvent():

I am getting an "Unhandled Exception" error on line 44 from the example you posted earlier. The line is,
If Not TempStream Notify "Unable to stream Music" ; Return


EDIT: Actually, it goes like this:

I build and run the code.
I press eject.
I select a song and press open.
Immediately after, I press eject.
I select a song and press open.
The "Unable to stream Music" notification occurs.
It plays for about two more seconds.
I get the "Unhandled Exception" error.