Followers

Tuesday, 17 October 2017

AVAudioEngine Xamarin.iOS not catched exception engine required running

Source: stackoverflow.com --- Tuesday, October 17, 2017
I'm using Xamarin.iOS for an application using AVAudioEngine. Sometimes I get this exception : AVFoundation_AVAudioPlayerNode_Play *** Terminating app due to uncaught exception 'com.Apple.coreaudio.avfaudio', reason: 'required condition is false: _engine->IsRunning()' This point to my code: private void PlayAudio() { try { NSError err; if (Engine.StartAndReturnError(out err)) { foreach (var audioTrack in _dicPlayerNodes) { audioTrack.Value.Play(); } } else { Messenger.Publish(new AudioErrorMessage(this) { Platform = "IOS", Code = Convert.ToInt32(err.Code), Message = err.LocalizedDescription ?? err.Description }); _exceptionHandlerService.PostHockeyApp(new Exception($"{err.Code} {err.Description}")); } } catch (Exception ex) { _exceptionHandlerService.PostExceptionAsync(ex).Forget(); } } I don't understand how is it possible to have this exception that engine is not running, because in my code I Start it and get error if it failed to start ... Then play it. Also I have a try catch that's not working in this case :( so my applicaton just crashed. Any advices or idea ? I comes to this thread but it doesn't help me to understand: http://ift.tt/1SVjpuQ.Apple.com/thread/27980 versions: IOS version : 10.3.3 Device: ipad 2 Xamarin.ios: 11.2.0.11 Thanks ...



from Apple http://ift.tt/2xKTbav

No comments:

Post a Comment