PDA

Click to See Complete Forum and Search --> : Sound API


percidae
Sep 28th, 2000, 06:15 PM
Is there any way to have the playsound api continuously loop a sound file? I been using:

Public Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long

along with declaring it in the form as:

retval = PlaySound("path to sound file", 0&, &H20000)

and can only get the sound file to play once. I tried to use &H8 (read this value would loop from a book) instead of &H20000, but then the sound wouldn't play at all. Help, 'cause I'm stumped.

Jason

Sep 29th, 2000, 02:26 PM
Use &H8 instead.

Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long

Private Sub Command1_Click()

'Play the WAV
PlaySound "C:\MyFile.wav", 0&, &H8

End Sub

Oct 4th, 2000, 07:38 AM
Originally posted by Megatron
Use &H8 instead.


Don't you have to OR it? i.e:


PlaySound "C:\MyFile.wav", 0&, &H200000 OR &H8


or:


PlaySound "C:\MyFile.wav", 0&, &H200008 ' (Same result)


or am I wrong?