public void AudioError(object sender, AudioSourceErrorEventArgs eventArgs) { if (File.Exists(baseDirectory + "AppFiles/TempFiles/" + TempFileName)) { File.Delete(baseDirectory + "AppFiles/TempFiles/" + TempFileName); } stopAll(); }
// Error handling private void Device_AudioSourceError(object sender, AudioSourceErrorEventArgs e) { if (videoPlayer.InvokeRequired) { videoPlayer.BeginInvoke((Action)((() => Device_AudioSourceError(sender, e)))); return; } StopRecording(); IAudioSource source = sender as IAudioSource; source.SignalToStop(); string msg = String.Format( // TODO: Move the message box code to the view CultureInfo.CurrentCulture, Resources.Error_Audio_Source, source.Source); MessageBox.Show(msg, source.Source, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, videoPlayer.RightToLeft == RightToLeft.Yes ? MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign : 0); }
void AudioDeviceAudioSourceError(object sender, AudioSourceErrorEventArgs eventArgs) { if (eventArgs.Description=="not connected") { Micobject.settings.active = false; NoSource = true; _processing = false; } if (!AudioSourceErrorState) { AudioSourceErrorState = true; Log.Error("Mic " + Micobject.id, new Exception("AudioSourceError: " + eventArgs.Description)); _reconnectTime = DateTime.Now; if (_errorTime == DateTime.MinValue) _errorTime = DateTime.Now; } if (!ShuttingDown) Invalidate(); }
private void AudioSource_AudioSourceError(object sender, AudioSourceErrorEventArgs e) { int x = 1; x++; }
/// <summary> /// This callback will be called when there is some error with the audio /// source. It can be used to route exceptions so they don't compromise /// the audio processing pipeline. /// </summary> /// private void source_AudioSourceError(object sender, AudioSourceErrorEventArgs e) { throw new Exception(e.Description); }
private void Audio_Error(object sender, AudioSourceErrorEventArgs e) { MessageBox.Show(e.ToString()); }