Results 1 to 3 of 3

Thread: sounds

  1. #1

    Thread Starter
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123

    sounds

    When I click a button I would like it to make a certain sound, and how do I "import this sound from a file? And not just the lame "beep()" sound either

  2. #2
    Lively Member
    Join Date
    Aug 1999
    Location
    Amsterdam
    Posts
    117
    The framework doesn't support sound yet, you'll have to use interop/pinvoke.

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    this little API works fine :


    VB Code:
    1. Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Integer, ByVal dwFlags As Integer) As Integer
    2.     Private Const SND_FILENAME As Integer = &H20000 '  name is a file name
    3.     Private Const SND_ASYNC As Short = &H1S '  play asynchronously
    4.     Private Const SND_SYNC As Short = &H0S
    5.     Private Const path As String = "specify the path here"
    6.  
    7. 'then call as follow :
    8. PlaySound(path & "\wavsound.wav", 0, SND_SYNC)

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