0
0

Hello everybody…

Tried to play a sound from memory…(made with PureBasic 4.0)
If i start, there are following errors…
FMOD_System_CreateSound —> 25 (FMOD_ERR_FILE_UNWANTED)
FMOD_Sound_SetMode —> 37 (FMOD_ERR_INVALID_HANDLE)

Does anybody know, were my error is or if there are wrong
parameters?

Thank yu very much….

[code:2cqqoqon]

FMOD_INIT_NORMAL = $00000000

FMOD_HARDWARE = $00000020

FMOD_LOOP_OFF = $00000001

FMOD_CHANNEL_FREE = -1

FMOD_OPENMEMORY = $00000800

Structure FMOD_CREATESOUNDEXINFO
cbSize.l
length.l
EndStructure

Global FMOD_CREATESOUNDEXINFO.FMOD_CREATESOUNDEXINFO
FMOD_CREATESOUNDEXINFO\cbSize=SizeOf(FMOD_CREATESOUNDEXINFO)
FMOD_CREATESOUNDEXINFO\length=191691

OpenLibrary(0,"fmodex.dll")
Debug CallFunction(0,"FMOD_System_Create", @system)
Debug CallFunction(0, "FMOD_System_Init", system, 32, #FMOD_INIT_NORMAL, 0)
Debug CallFunction(0, "FMOD_System_CreateSound",system,?song, #FMOD_HARDWARE | #FMOD_LOOP_OFF | #FMOD_OPENMEMORY, *FMOD_CREATESOUNDEXINFO.FMOD_CREATESOUNDEXINFO, @sound)
Debug CallFunction(0, "FMOD_Sound_SetMode", sound, #FMOD_LOOP_OFF)

OpenWindow(0,0,0,100,100,"TEST",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
CreateGadgetList(WindowID(0))
ButtonGadget (1, 10, 10,80, 80, "Play sound")

Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
CallFunction(0, "FMOD_System_PlaySound", system, #FMOD_CHANNEL_FREE, sound, 0, @channel)
EndIf
Until EventID = #PB_Event_CloseWindow

CallFunction(0, "FMOD_Sound_Release", sound)
CallFunction(0, "FMOD_System_Close", system)

CloseLibrary(0)

DataSection
song:IncludeBinary "hypnosis.mod"
EndDataSection

[/code:2cqqoqon]

  • You must to post comments
0
0

problem is solved

Thanks….

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.