Results 1 to 3 of 3

Thread: Help sound resource file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Posts
    158

    Help sound resource file

    This is a exe with a sou d file stored ina resoucre it crashes on my computer for some reason

    Please HElp

    Code:
    Option Explicit
    
    Private Declare Function sndPlaySound Lib "winmm.dll" _
                    Alias "sndPlaySoundA" _
                    (ByVal lpszSoundName As String, _
                    ByVal uFlags As Long) As Long
    
    Private Const SND_ASYNC = &H1  '  play asynchronously
    Private Const SND_MEMORY = &H4 '  lpszSoundName points to a memory file
    Private Const SND_NODEFAULT = &H2  '  silence not default, if sound not found
    
    
    Private Sub PlayIt(WavID As Variant)
      Dim SoundBuffer As String
      SoundBuffer = StrConv(LoadResData(WavID, "WAVE"), vbUnicode)
      sndPlaySound SoundBuffer, SND_ASYNC Or SND_NODEFAULT Or SND_MEMORY
    End Sub
    
    
    Private Sub Command1_Click()
     PlayIt "CHIMES"
    End Sub
    
    Private Sub Command2_Click()
     PlayIt "CHORD"
    End Sub
    
    Private Sub Command3_Click()
    PlayIt "DING"
    End Sub

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344
    You have to stop the sound that is playing before playing another.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Posts
    158
    whast the command
    is this it PlaySound vbNullString, 0, 0

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