Лабораторная работа: Audio recorder on visual basic
On Error GoTo ErrHandler1
CommonDialog2. Filter = "Midi file (*. mid*) |*. mid"
CommonDialog2. Flags = &H2 Or &H400
CommonDialog2. ShowOpen
WaveMidiFileName = CommonDialog2. FileName
WaveMidiFileName = GetShortName (WaveMidiFileName)
ErrHandler1:
End Sub
Private Sub cmdOke_Click ()
Unload Me
End Sub
Private Sub cmdStartTime_Click ()
Dim wrst As String
wrst = WaveRecordingStartTime
wrst = InputBox ("Enter start time recording", "Start time", wrst)
If wrst = "" Then Exit Sub
If Not IsDate (wrst) Then
MsgBox ("The date/time you entered was not valid!")
Else
' String returned from InputBox is a valid time,
' so store it as a date/time value in WaveRecordingStartTime.
If CDate (wrst) < Now Then
MsgBox ("Recording events in the past is not possible... ")
WaveRecordingStartTime = Now + TimeSerial (0, 15, 0)
Else
WaveRecordingStartTime = CDate (wrst)
End If
If WaveRecordingStopTime < WaveRecordingStartTime Then WaveRecordingStopTime = WaveRecordingStartTime + TimeSerial (0, 15, 0)
End If