xamarin / ios-samples

Xamarin.iOS sample apps
http://docs.microsoft.com/xamarin/ios/
Other
1.59k stars 1.92k forks source link

Error in SpeakToMe setting the audio session category and mode #377

Closed stephen-hawley closed 5 months ago

stephen-hawley commented 5 years ago

The sample as written calls SetCategory and SetMode early on in StartRecording. It needs to either save their initial values and set them back on completion or set them to defaults (Playback and ModeDefault).

Failing to do so inhibits audio output on devices (although it works in simulator).

Example code:

                if (error != null || isFinal) {
                    audioSession.SetCategory (AVAudioSessionCategory.Playback);
                    audioSession.SetMode (AVAudioSession.ModeDefault, out err);
                    node.RemoveTapOnBus (0);
                    audioEngine.Dispose ();
                    recognitionRequest.Dispose ();
                    recognitionTask.Dispose ();
                    recognitionRequest = null;
                    recognitionTask = null;
                }
rolfbjarne commented 5 months ago

Microsoft support for Xamarin will end on May 1, 2024 for all Xamarin SDKs. In preparation for this, all issues and PRs in this repository are being closed.