Fmod incbin mp3

BlitzMax Forums/BlitzMax Beginners Area/Fmod incbin mp3

u2o(Posted 2006) [#1]
Hi,

I have started writing my first project with BMAX and have decided to use an mp3 for the audio, taking advantage of the Fmod module.

What I want to do is include the mp3 into the program via the 'Incbin' command, but the problem I am having is that once the file is incbinned, I cannnot play it.

IncBin "mymp3.mp3"

Global Music:Int
FSOUND_Init(22000,256,0)
Music = FSOUND_Sample_Load(1,"incbin::mymp3.mp3",0,0,0)

FSOUND_PlaySound(1,Music)


If I rem the 'Incbin' command and modify the 'FSOUND_Sample_Load' parameters to:
Music = FSOUND_Sample_Load(1,"mymp3.mp3",0,0,0)

.. then everythin plays as expected, but obviously the file in no longer included and is called on execution of the program.

I did modify the code to use 'IncBinPtr' and 'IncBinLen', but to no avail.

If you have any pointers/advice or a solution, it would be very appreciated.

Thanks


u2o(Posted 2006) [#2]
UPDATE: I have for the moment converted the mp3 to OGG, which has resulted in better compression and a smaller filesize :) So I am favouring this at the moment.

However, I am still curious and would like some thought on my original question.

Cheers,


JazzieB(Posted 2006) [#3]
FMOD uses an external DLL, which doesn't recognise the "incbin::" portion of the file name. Blitz is passing the filename of the sound/music you want to load, not a pointer to the incbin'd file, which it then fails to load because of the "incbin::" bit. I don't think there is any way of using incbin'd files with FMOD at this time.


u2o(Posted 2006) [#4]
That is what I was thinking, good job there was a backup plan :)

There is an example with the FMOD module for including XM files and this uses a pointer to the incbin (IncbinPtr) which is what I based my original code on for including the MP3. The big difference is with the audio command to play the XM (different command and parameters for an external loaded file vs an incbin one). I had a look through the source of the module to see if there was any similar parameters to call an incbin MP3, but no luck!

Never mind, it's not that important for now.

Many thanks for your help.