Page 1 of 1

Posted: Wed Nov 06, 2002 9:35 pm
by BackupUser
Restored from previous forum. Originally posted by Kale.

is there a way to embed mod files within PB maybe using somethign like:

Code: Select all

Music: IncludeBinary "whatever.mod"
LoadModule(0, ?Music)


--Kale

New to PureBasic and falling in Love! :)

Posted: Thu Nov 07, 2002 1:53 am
by BackupUser
Restored from previous forum. Originally posted by TheBeck.

Look for the itcanbedone demo here: http://www.reelmediaproductions.com/pb/appsinpb.html
This demo puts a MIDI music track into the executable. When the program is run it saves the MIDI music file into a temp directory then loads it and erases the file upon exit. Hope this helps.

Posted: Fri Nov 08, 2002 3:25 am
by BackupUser
Restored from previous forum. Originally posted by chr1sb.

Here's an example which uses bassmod libray (from http://www.un4seen.com/music/) to play the mod straight from memory

Code: Select all

OpenLibrary(0, "bassmod.dll")

If OpenWindow(0, 200, 200, 200, 200, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget , "PureBasic Window")

CallFunction(0, "BASSMOD_Init" ,-1,44010,16)
CallFunction(0, "BASSMOD_MusicLoad",1,?music,0,0,2)
CallFunction(0, "BASSMOD_SetVolume",50)
CallFunction(0, "BASSMOD_MusicPlay")

Repeat

  EventID.l = WindowEvent()

  Until EventID = #PB_Event_CloseWindow
    
EndIf

Result = CallFunction(0, "BASSMOD_MusicStop")
CloseLibrary(0)

End

music:
IncludeBinary"music.mod"
BTW: I posted this example before but it's in the archived posts section. so sorry if I've contravened board etiquette by duplicating it here for convenience)

chr1sb