Closed rburnashev85 closed 10 months ago
Why are you using the above code snippet?
Anyway the issue is because it is changing the overall category for media. You will need to undo this change once you have finished using it for whatever purpose it is. Or find an alternative option from AVAudioSessionCategory
.
That being said I would like to investigate how we could provide a mechanism to change values like this easily
I used it to make audio play in iPhone's silent mode as it is described in your wiki https://github.com/jfversluis/Plugin.Maui.Audio/wiki It would be nice if your library would provide some option to play sound though silent mode. Not breaking microphone of course :-)
For now a workaround would be to keep track of what AVFoundation.AVAudioSession.SharedInstance().Category
is before you change it and then set that value back after playing the audio.
I experienced microphone issues on iOS using Azure speech services after I ran this code snipped.
https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/2188