ERFORDERLICHE
OBJEKTE
1 Commandbutton (Command1)
FORM-CODE
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
Function Wave_Länge(Dateiname)
Dim i As Long, RS As String, cb As Long, s As Single
Wave_Länge = 0
RS = Space$(128)
i = mciSendString("stop sound", RS, 128, cb)
i = mciSendString("close sound", RS, 128, cb)
i = mciSendString("open waveaudio!" & _
Dateiname & " alias sound", RS, 128, cb)
If i Then Wave_Länge = -1
i = mciSendString("status sound length", RS, 128, cb)
If Wave_Länge = 0 Then Wave_Länge = RS / 1000
i = mciSendString("stop sound", RS, 128, cb)
i = mciSendString("close sound", RS, 128, cb)
End Function
Private Sub Command1_Click()
L = Wave_Länge("c:\datei.wav")
If L = -1 Then
MsgBox "Fehler"
Else
MsgBox "Länge: " & L & " Sekunden"
End If
End Sub
siehe
auch
Soundkarte vorhanden ?
Soundkarteneinstellungen
Wavedatei in EXE-Datei integrieren
Wavedatei abspielen
|