|
-
Feb 5th, 2014, 10:33 AM
#1
Thread Starter
PowerPoster
[RESOLVED] make a sound file repeat using WINMM.DLL
i am trying to make a sound file loaded from a resource file repeat until stopped using WINMM.DLL
Dim sndData() As Byte
Private Declare Function sndPlaySound Lib "WINMM.DLL" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As _
Long) As Long
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Const SND_LOOP = &H8
Const SND_NOSTOP = &H10
play the sound
sndData = LoadResData("hit", "SOUND")
sndPlaySound sndData(0), SND_LOOP
stop the sound
sndPlaySound ByVal 0, 0
how can this be done?
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Feb 5th, 2014, 11:06 AM
#2
Re: make a sound file repeat using WINMM.DLL
I'm trying to wrap my mind around the fact, that the API expects a string and he sends the first member of his byte-array
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Feb 5th, 2014, 11:38 AM
#3
Thread Starter
PowerPoster
Re: make a sound file repeat using WINMM.DLL
for some reason oi got to work by changing this line:
sndPlaySound sndData(0), SND_LOOP
to this
sndPlaySound sndData(0), SND_LOOP Or SND_ASYNC Or SND_MEMORY
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Feb 5th, 2014, 12:10 PM
#4
Re: [RESOLVED] make a sound file repeat using WINMM.DLL
Look up the difference between SND_SYNC and SND_ASYNC. That'll help you understand.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|