Private recorder As AudioRecorder 'iMedia library
Sub btnRecord_Click
Try
pg.ResignFocus
If File.Exists(File.DirDocuments,VoiceMessageFileName)=True Then
Dim sf As Object = XUI.Msgbox2Async("Do you want to record audio file again?", "HCMS", "Yes", "", "No", Null)
Wait For (sf) Msgbox_Result (Result As Int)
If Result <> XUI.DialogResponse_Positive Then
Return
End If
Dim Del As Boolean
Del=File.Delete(File.DirDocuments,VoiceMessageFileName)
Log("File " & VoiceMessageFileName & " deleted " & Del & " before recording")
End If
Buttons("Record")
StartRecording
Catch
Log("btnRecord_Click " & LastException.description)
End Try
End Sub
Sub StartRecording
Try
recorder.Initialize(AudioFileDir,VoiceMessageFileName, 44100, True, 16, False)
lblTimer.Text=""
recordingStart = DateTime.Now
timer2.Enabled=True
Timer2_Tick
recorder.Record
Log("StartRecording")
Catch
Log("StartRecording " & LastException.description)
End Try
End Sub
Sub StopRecording
Try
timer2.Enabled=False
recorder.Stop
Log("StopRecording")
Catch
Log("StopRecording " & LastException.description)
End Try
End Sub