Page 1 of 2

Include mp3 file in exe

Posted: Thu May 08, 2003 3:09 pm
by Cor
Is there a way to include an mp3 file in exe and play it

There is no Catchsound for mp3.

Can I expand the mp3 file to memory instead of a tmp directory and play the mp3 file from memory.

The OGG sound is no good for me because it take a long time to load from catchsound

starting like...

Code: Select all

L1= ?LB2-?LB1  ; length of mp3 file

IB1:
includebinary "test.mp3"
IB2:


Re: Include mp3 file in exe

Posted: Thu May 08, 2003 8:25 pm
by WolfgangS
Cor wrote:Is there a way to include an mp3 file in exe and play it

There is no Catchsound for mp3.

Can I expand the mp3 file to memory instead of a tmp directory and play the mp3 file from memory.

The OGG sound is no good for me because it take a long time to load from catchsound

starting like...

Code: Select all

L1= ?LB2-?LB1  ; length of mp3 file

IB1:
includebinary "test.mp3"
IB2:

You can include it as a binary file (create a .exe) and exclude it from memory ( to disk) before you use it. There are a few examples here in the forum.

MFG
WolfgangS

Posted: Fri Jun 13, 2003 6:56 pm
by tkruk
Why doesn't PureBasic support MP3s internally. With CatchSound
or something??? Seems like Blitz and Jamagic do it already...

Also what is the best format for music playback that IS included in
the EXE? (for a demo and such)

Tom.

Posted: Fri Jun 13, 2003 6:59 pm
by PB
> Why doesn't PureBasic support MP3s internally

Because a license fee has to be paid to decode MP3s (or something).
A fee comes into the mix somewhere, anyway.

Posted: Fri Jun 13, 2003 7:21 pm
by ricardo
PB wrote:> Why doesn't PureBasic support MP3s internally

Because a license fee has to be paid to decode MP3s (or something).
A fee comes into the mix somewhere, anyway.
But can use LAME to avoid fees.
Latest LAME can be used as static lib.

@Cor

Did you try using some winamp dlls? I think i see somewhere some that can be pointed to memory to play... im not sure.

Posted: Sat Jun 14, 2003 11:06 am
by Fred
No, all mp3 based decoder are patented. I have already have a working library based on LAME but I can't publish it inside PureBasic, I've emailed the authors and the response is clear: it's very expensive. About the speed, switching from ogg to mp3 will have absolutely not difference, as the mp3 needs to be unpacked completely, which took roughly the same times than unpacking an ogg.. It's not a Wav :). The only solution is using a streaming routine, as I've already said.

Posted: Sat Jun 14, 2003 4:17 pm
by tkruk
Fred:

I am sorry if my comment is dumb, but was just curious does BB and Jamagic have to license the MP3 code and pay $$$$ or do you think
they made their own from scratch???

Tom.

Posted: Sat Jun 14, 2003 5:33 pm
by ricardo
tkruk wrote:Fred:

I am sorry if my comment is dumb, but was just curious does BB and Jamagic have to license the MP3 code and pay $$$$ or do you think
they made their own from scratch???

Tom.
Most mp3 software uses fraunhofer codecs installed on the user PC or LAME library without need to pay any licence.

Posted: Sun Jun 15, 2003 6:45 pm
by Fred
just take a look to the following link to see what I mean.

http://www.mp3licensing.com/royalty/index.html

I should paid 0.75 US$ per PureBasic copy sold to include it in the core, and the best is than every user which will use it will have to paid the royalities too... When you have an fully free, very high quality alternative like OGG, there is no way for me, to even support MP3 in the PureBasic core. The MP3 owner attitude is really as they have waited than mp3 becomes a standard before locking it with patents. Spread the words...

Posted: Sun Jun 15, 2003 7:15 pm
by WolfgangS
Fred wrote:just take a look to the following link to see what I mean.

http://www.mp3licensing.com/royalty/index.html
Why not offer the User MP3 via an external Library and full inplemented OGG support ?

MFG
WolfgangS

::amazed::

Posted: Mon Jun 16, 2003 12:01 pm
by 8bit
The seems like a VERY large price for a simple MP3 Encode/Decoder. I wonder how hard it is to make a MP3 Encoder/Decoder? We should attempt it!! heheh

Posted: Mon Jun 16, 2003 2:52 pm
by Fred
The mp3 technology is patent. Even if you write the decoder yourself, you have to paid.. It's not a code licensing here.

Posted: Mon Jun 16, 2003 6:22 pm
by ricardo
Fred wrote:The mp3 technology is patent. Even if you write the decoder yourself, you have to paid.. It's not a code licensing here.
But the patents of mp3 are not valid everywhere. As far as i can remember, only in Germany and US. Many countries (even in europe) dosen't consider it valid.
In the first times (90s) Fraunhofer try to stop things like LAME, Bladeenc, etc. but they can't since many countries declare that the patents are not valid on their countries. From then you can find/use/download many mp3 encoder decoders without any problem.
At the beggining only Fraunhofer and Xing, now there are many.
In fact Fraunhofer dosen't has success trying to get money from patens in the late 90s and i think they abandon this effort, Microsoft is his client and with this one they go to every PC.


But Fred, you could use the codex that Microsoft paid and that are allready installed on the PC (fraunhofer ones) and dont need to pay for using it.

Posted: Mon Jun 16, 2003 8:23 pm
by tkruk
Perhaps Fred will come out with OGG stream
and then we just convert mp3s to that. That would be
fine too...

What I don't get is again, think of
-Macromedia Flash
-Jamagic
-BlitzBasic

Maybe they had to pay a fee. But the developers do not
have to pay fees.

My company owns Flash, and we make tons of stuff with it
AND we use mp3 in them all the time (music, voice, etc)... WE NEVER
HAD TO PAY any licencing for the MP3.

Same with Jamagic and Blitz. No developer pays for that.......

If Fred could work out the same type of deal given the presedance
of Flash, Jamagic, and Blitz... Why NOT? I would gladly donate money
to Fred for the functionality. I'm sure many would as well......

Re: Include mp3 file in exe

Posted: Mon Jun 16, 2003 8:47 pm
by ricardo
@Cor

I don't knopw if its possible now to play wav from memory, but this is something that Fred could add without the licence problem.

Then you can packyou wav file, unpack it to memory and play it from there.

Finally mp3 is just a way to encode a file and make it smaller. Having pack command could let us pack sounds, unpack them to memory and play it from there.

Fred what do you think?

The only problems on wav files could be the size on memory?