VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Through this code you can play any wav file and generate different sounds on various VB events as p

by RITIK DODHIWALA (5 Submissions)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 28th September 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Through this code you can play any wav file and generate different sounds on various VB events as per your Application

Rate Through this code you can play any wav file and generate different sounds on various VB events as p



Option Explicit

Private Declare Function sndPlaySound Lib "winmm" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Public Enum SND_Settings
    SND_SYNC = &H0
    SND_ASYNC = &H1
    SND_NODEFAULT = &H2
    SND_MEMORY = &H4
    SND_LOOP = &H8
    SND_NOSTOP = &H10
    SW_SHOW = 5
End Enum

Public Sub Play(fname As String, Optional Settings As SND_Settings = SND_ASYNC)
    Dim retval As Long
    retval = sndPlaySound(fname, Settings)
End Sub

'''''Paste following code in form

Private Sub Command1_Click()
 Play "C:\program files\Messenger\online.wav"
End Sub


Download this snippet    Add to My Saved Code

Through this code you can play any wav file and generate different sounds on various VB events as p Comments

No comments have been posted about Through this code you can play any wav file and generate different sounds on various VB events as p. Why not be the first to post a comment about Through this code you can play any wav file and generate different sounds on various VB events as p.

Post your comment

Subject:
Message:
0/1000 characters