| |
|
 |
Visual Basic Api Play-Stop Sound | Genel | View / 1269 | |
 |
Visual Basic Api ile sound play and stop işlemi.
Çalınan dosyanın konumunu ( uzun veya kısa olması ) ve dosya çalarken durdurulması için
en pratik kod.
Play sound , long file name and path or play and stop command.
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_SYNC = &H0
Private Const SND_ASYNC = &H1
Private Const SND_NODEFAULT = &H2
Private Const SND_MEMORY = &H4
Private Const SND_LOOP = &H8
Private Const SND_NOSTOP = &H10
Private Const SND_PURGE = &H40
Public Sub PlaySound(strSound As String)
sndPlaySound strSound, SND_ASYNC Or SND_NODEFAULT
End Sub
Public Sub StopSound(strSound As String)
sndPlaySound vbNullString, SND_PURGE
End Sub
Private Sub Command2_Click()
StopSound App.Path & "\phone.wav"
End Sub
Private Sub Command2_Click()
StopSound App.Path & "\phone.wav"
End Sub
|
|
|