Automatisk gentagelse af lyd x antal gange pr. minut
Hvordan får jeg mit program til at automatisk gentage en lyd et angivet antal (i en box) gange pr. minut?Koden jeg bruger til aktivering af lyden ses nedenfor.
Option Explicit
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, _
ByVal lpstrReturnString As String, _
ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Sub C2_Click()
Dim i As Long, RS As String, cb As Long
RS = Space$(128)
i = mciSendString("stop sound", RS, 128, cb)
i = mciSendString("close sound", RS, 128, cb)
End Sub
Private Sub C_Click()
C2_Click
Dim i As Long, RS As String, cb As Long, W$
RS = Space$(128)
W$ = "C:\keys\c.wav"
i = mciSendString("open waveaudio!" & W$ & " alias sound", RS, 128, cb)
If i Then MsgBox "Error! Probably file not found."
i = mciSendString("play sound", RS, 128, cb)
End Sub
