FMOD Community Project

BlitzMax Forums/BlitzMax Programming/FMOD Community Project

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I think you have to load the fmod.dll as a standard dll withe the lib = LoadLibraryA ("fmod.dll")

Something like this...
If FileSize("fmod.dll") = -1

	Incbin "data/fmod.dll"
	
	Local fmodptr:Byte Ptr=IncbinPtr("data/fmod.dll")
	Local fmodlen:Int=IncbinLen("data/fmod.dll")
	
	sfile=WriteFile("fmod.dll")
	WriteLine(sfile,string.frombytes(fmodptr,fmodlen))
	CloseStream sfile

EndIf

Incbin "data/4k.xm"

lib = LoadLibraryA ("fmod.dll")

Local initsong(p1:Int,p2:Int,p3:Int) "win32"
Local closesong() "win32"
Local loadsong(song:Byte Ptr,offset:Int,songlen:Int,mode:Int,par1:Int,par2:Int) "win32"
Local playsong(songptr:Int) "win32"

initsong = GetProcAddress (lib,"_FSOUND_Init@12")
closesong = GetProcAddress (lib,"_FSOUND_Close@0")
loadsong = GetProcAddress (lib,"_FMUSIC_LoadSongEx@24")
playsong = GetProcAddress (lib,"_FMUSIC_PlaySong@4")

initsong(22000,265,0)


Local music=loadsong(IncbinPtr("data/4k.xm"),0,IncbinLen("data/4k.xm"),FSOUND_LOADMEMORY,0,0)
playsong(music)

Input("Press any key...")

closesong()
End


P.S remember to turn off "Build Gui App" for this code!

Sveinung