Does anyone have an mp3 player source they'd like to post (for those of us who don't have mp3 registered in the section of system.ini (and how do you get it registered anyway?))??

I'm also curious if anyone has messed around with fmod.dll in masm?

http://www.fmod.org/

I've played around with PedroGC's "wav to mp3 converter" from NaGoA's package, and was starting to port it to QEditor, but thought I'd check and see if anyone had already done this.
Posted on 2001-09-24 13:41:45 by gscundiff
Hi ! I haven't got a mp3-player in asm, but I have made some experience with the fmod.dll. It's quite easy to handle with. It's SDK contains a masm-includefile and the given examples in c/c++ are easy to translate. (At the moment I only uses the module-playing-capability of fmod but playing mp3 should be as simple as this ...)

Greetings, CALEB
Posted on 2001-09-25 16:39:45 by Caleb
AHA...

In the readme.txt from Iczelion/Source/mp3demo by LordRhesus:
-------------------------------
In order for these programs to work you need to have the file 'Msvfw32.dll' present on your system. If it isn't present then you need to install windows media player, the easiest way to get this is to look at distributions of Internet Explorer found on most demo CDs. Just install and ask to do a Expert install and select to install windows media player (ignore the rest). Also you need to the following entry present in your system.ini file under the section:
MPEGVideo=mciqtz.drv
--------------------------------

Well, I had Msvfw32.dll in my System folder, and the MPEGVideo=mciqtz.drv was in the section of my System.ini, but it still wouldn't work.:confused:

So I decided to re-install M$MediaPlayer and VOILA! :)

I can now play mp3's with MCI control programs!:alright:

Thanks Caleb for the nfo on fmod.dll
(I'd be interested in seeing any code you have to access the module-playing-capability of fmod) ;)
Posted on 2001-09-26 05:17:06 by gscundiff
Hi, here is the code you need to use fmod for playing modules or mp3:



include Music\fmod.inc
includelib f:\masm32\lib\music\fmod.lib
IFDEF _UseMP3_
cMusicFile db "MyMP3Song",0
ELSE
cMusicFile db "MyModule",0
ENDIF
align 16


InitMusic: pushad

invoke FSOUND_SetOutput, FSOUND_OUTPUT_DSOUND
test eax, eax
je InMs_Exit

invoke FSOUND_SetDriver, 0
test eax, eax
je InMs_Exit

invoke FSOUND_Init, 44100, 21, FSOUND_INIT_USEDEFAULTMIDISYNTH
test eax, eax
je InMs_Exit
IFDEF _UseMP3_
invoke FSOUND_Stream_OpenFile, addr cMusicFile, FSOUND_LOOP_NORMAL,0
ELSE
invoke FMUSIC_LoadSong, addr cMusicFile
ENDIF
test eax, eax
je InMs_Exit
mov cMod, eax

invoke FMUSIC_SetMasterVolume, eax, cMusicVol

ENDIF

InMs_Exit: popad
ret


align 16

PlayMusic: pushad

mov eax, cMod
test eax, eax
je @F
IFDEF _UseMP3_
invoke FSOUND_Stream_Play, 0, eax
ELSE
invoke FMUSIC_PlaySong, eax
ENDIF
@@:
popad
ret

align 16

StopMusic: pushad

mov eax, cMod
test eax, eax
je @F
IFDEF _UseMP3_
invoke FSOUND_Stream_Stop, eax
ELSE
invoke FMUSIC_StopSong, eax
ENDIF
@@:

popad
ret

align 16

CloseMusic: pushad

mov eax, cMod
test eax, eax
je @F
IFDEF _UseMP3_
invoke FSOUND_Stream_Stop, eax
invoke FSOUND_Stream_Close, cMod
ELSE
invoke FMUSIC_StopSong, eax
invoke FMUSIC_FreeSong, cMod
ENDIF
@@:

popad
ret



Just call InitMusic for initialise the player, PlayMusic for start the playing in background, StopMusic for stooping the music. And when you do not need it anymore call CloseMusic

Greetings, CALEB
Posted on 2001-09-27 04:38:12 by Caleb
Thanks Caleb !! I'll try it out here in a minute.:alright:
Posted on 2001-09-27 08:08:01 by gscundiff