Results 1 to 3 of 3

Thread: Sound API

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    Charleston, S.C.
    Posts
    21
    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

  2. #2
    Guest
    Use &H8 instead.
    Code:
    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

  3. #3
    Guest
    Originally posted by Megatron
    Use &H8 instead.
    Don't you have to OR it? i.e:

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

    Code:
    PlaySound "C:\MyFile.wav", 0&, &H200008  ' (Same result)
    or am I wrong?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width