Results 1 to 5 of 5

Thread: playing a simple .wav file

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Posts
    484

    playing a simple .wav file

    pls teach me how to play a simple .wav file using the simplest method!

    thanx
    thanx
    thanx

  2. #2
    Frenzied Member
    Join Date
    Aug 2001
    Posts
    1,075
    Put this in a module

    VB Code:
    1. Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    2.  
    3. Public Const SND_ASYNC = &H1         '  play asynchronously

    Then call it like this
    VB Code:
    1. sWavFile = "C:\windows\media\Ding.wav"
    2. x = sndPlaySound(sWaveFile, SND_ASYNC)

    Greg
    Free VB Add-In - The Reference Librarian
    Click Here for screen shot and download link.

  3. #3
    Addicted Member
    Join Date
    Sep 2001
    Location
    UK
    Posts
    136
    kool is the wav a restricted lenth or size though?

  4. #4
    Frenzied Member
    Join Date
    Aug 2001
    Posts
    1,075
    Nope.

    Greg
    Free VB Add-In - The Reference Librarian
    Click Here for screen shot and download link.

  5. #5
    Addicted Member
    Join Date
    Sep 2001
    Location
    UK
    Posts
    136
    Wicked. Thanks for the code.

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