Beispiel #1
0
 protected virtual void OnErrorOccurred(AudioGraphUnrecoverableErrorOccurredEventArgs e)
 {
     State      = MediaPlaybackState.None;
     LastStatus = e.Error.ToString();
     ErrorOccurred?.Invoke(this, e);
     OnMediaEnd();
 }
Beispiel #2
0
 // <SnippetUnrecoverableError>
 private void AudioGraph_UnrecoverableErrorOccurred(AudioGraph sender, AudioGraphUnrecoverableErrorOccurredEventArgs args)
 {
     if (sender == audioGraph && args.Error != AudioGraphUnrecoverableError.None)
     {
         Debug.WriteLine("The audio graph encountered and unrecoverable error.");
         audioGraph.Stop();
         audioGraph.Dispose();
         InitAudioGraph();
     }
 }
Beispiel #3
0
        /// <summary>
        /// Handles AudioGraph errors (e.g. device change) and attempts to restart playback from same position
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private async void Graph_UnrecoverableErrorOccurred(AudioGraph sender, AudioGraphUnrecoverableErrorOccurredEventArgs args)
        {
            Console.WriteLine(String.Format("Unrecoverable Error Occurred, restaring: {0}", args.Error.ToString()));
            TimeSpan CurrentPlayPosition = currentAudioFileInputNode != null ? currentAudioFileInputNode.Position : TimeSpan.Zero;

            sender.Dispose();
            StartButtonEnabled = false;
            StopButtonEnabled  = false;
            await LoadAudioFile(CurrentPlayPosition);
        }
Beispiel #4
0
 private async void Graph_UnrecoverableErrorOccurred(AudioGraph sender, AudioGraphUnrecoverableErrorOccurredEventArgs args)
 {
     // Recreate the graph and all nodes when this happens
     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() =>
     {
         sender.Dispose();
         // Re-query for devices
         await PopulateDeviceList();
         // Reset UI
         fileButton.IsEnabled             = false;
         recordStopButton.IsEnabled       = false;
         recordStopButton.Content         = "Record";
         outputDeviceContainer.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
         audioPipe1.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
         audioPipe2.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
     });
 }
Beispiel #5
0
 private async void OnAudioGraphError(AudioGraph sender, AudioGraphUnrecoverableErrorOccurredEventArgs args)
 {
     await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
         CoreDispatcherPriority.Normal,
         () => DiagnosticsInfo = $"Audio Graph Error: {args.Error}\r\n");
 }
 private void Graph_UnrecoverableErrorOccurred(AudioGraph sender, AudioGraphUnrecoverableErrorOccurredEventArgs args)
 {
     throw new NotImplementedException();
 }
 private async void Graph_UnrecoverableErrorOccurred(AudioGraph sender, AudioGraphUnrecoverableErrorOccurredEventArgs args)
 {
     // Recreate the graph and all nodes when this happens
     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
     {
         sender.Dispose();
         // Re-query for devices
         await PopulateDeviceList();
         // Reset UI
         fileButton.IsEnabled = false;
         recordStopButton.IsEnabled = false;
         recordStopButton.Content = "Record";
         outputDeviceContainer.Background = new SolidColorBrush(Color.FromArgb(255, 74, 74, 74));
         audioPipe1.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
         audioPipe2.Fill = new SolidColorBrush(Color.FromArgb(255, 49, 49, 49));
     });
 }
		private void OnGraph_UnrecoverableErrorOccurred(AudioGraph sender, AudioGraphUnrecoverableErrorOccurredEventArgs args)
		{
			_messageWriter.LastMessage = args.Error.ToString();
			// Recreate the graph and all nodes when this happens
			//sender.Dispose();
			//DisposeAudioGraph();

			UnrecoverableError?.Invoke(this, EventArgs.Empty);

			// Re-query for devices // LOLLO NO!
			// _messageWriter.LastMessage = await CreateAudioGraphAsync().ConfigureAwait(false);
		}
 private async void Graph_UnrecoverableErrorOccurred(AudioGraph sender, AudioGraphUnrecoverableErrorOccurredEventArgs args)
 {
     // Recreate the graph and all nodes when this happens
     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         sender.Dispose();
     });
 }
Beispiel #10
0
 private void AudioGraph_UnrecoverableErrorOccurred(AudioGraph sender, AudioGraphUnrecoverableErrorOccurredEventArgs args)
 {
     Debug.WriteLine("UNRECOVERABLE ERRORRRRRR");
 }
Beispiel #11
0
        async void Graph_UnrecoverableErrorOccurred(AudioGraph sender, AudioGraphUnrecoverableErrorOccurredEventArgs args)
        {
            await Stop();

            throw new Exception($"UnrecoverableErrorOccurred error: {args.Error}");
        }