Лабораторная работа: Audio recorder on visual basic
If i <> 0 Then MsgBox ("Start playing failed!")
End Sub
Public Sub WaveStatus ()
Dim i As Long
WaveStatusMsg = Space (255)
i = mciSendString ("status capture mode", WaveStatusMsg, 255, 0)
If i <> 0 Then MsgBox ("Failure getting wave status... ")
WaveStatusMsg = "AudioRecorder: " & WaveStatusMsg
End Sub
Public Sub WaveStatistics ()
Dim mssg As String * 255
Dim i As Long
i = mciSendString ("set capture time format ms", 0&, 0, 0)
If i <> 0 Then MsgBox ("Setting time format in milliseconds failed!")
i = mciSendString ("status capture length", mssg, 255, 0)
mssg = CStr (CLng (mssg) / 1000)
If i <> 0 Then MsgBox ("Finding length recording in milliseconds failed!")
WaveStatisticsMsg = "Length recording " & Str (mssg) & " s"
i = mciSendString ("set capture time format bytes", 0&, 0, 0)
If i <> 0 Then MsgBox ("Setting time format in bytes failed!")
i = mciSendString ("status capture length", mssg, 255, 0)
If i <> 0 Then MsgBox ("Finding length recording in bytes failed!")
WaveStatisticsMsg = WaveStatisticsMsg & " (" & Str (mssg) & " bytes)" & vbCrLf
i = mciSendString ("status capture channels", mssg, 255, 0)
If i <> 0 Then MsgBox ("Finding number of channels failed!")
If Str (mssg) = 1 Then
WaveStatisticsMsg = WaveStatisticsMsg & "Mono - "
ElseIf Str (mssg) = 2 Then
WaveStatisticsMsg = WaveStatisticsMsg & "Stereo - "