Sub btnStartRecording_Click
Try
ReleaseAudioStreamer
Catch
Log(LastException.Message)
End Try
'Try to initialise the Audiostreamer
Try 'Option 1
streamer.Initialize("streamer", 8000, True, 16, streamer.VOLUME_MUSIC)
Log("Sample Rate of 8000 worked")
Catch 'oops Option 1 didn't work
Try 'Option 2
streamer.Initialize("streamer", 11025, True, 16, streamer.VOLUME_MUSIC)
Log("Sample Rate of 11025 worked")
Catch 'oops Option 2 didn't work
Try 'Option 3
streamer.Initialize("streamer", 16000, True, 16, streamer.VOLUME_MUSIC)
Log("Sample Rate of 16000 worked")
Catch
Try 'Option 4
streamer.Initialize("streamer", 22050, True, 16, streamer.VOLUME_MUSIC)
Log("Sample Rate of 22050 worked")
Catch
Try 'Option 5
streamer.Initialize("streamer", 44100, True, 16, streamer.VOLUME_MUSIC)
Log("Sample Rate of 44100 worked")
Catch
Log("I'm out of options!")
ToastMessageShow("Failed to Initialize Record, it would seem that your device is not compatible", False)
Return
End Try 'Option 5
End Try 'Option 4
End Try 'Option 3
End Try 'Option 2
End Try 'Option 1
buffers.Clear
streamer.StartRecording
recordingStart = DateTime.Now
timer1.Enabled = True
Timer1_Tick
btnPlay.Enabled = False
End Sub