adrianstevens / Xamarin-Plugins

Cross-platform Plugins for Xamarin, Xamarin.Forms and Windows
https://www.nuget.org/packages/Xam.Plugin.SimpleAudioPlayer/
MIT License
132 stars 53 forks source link

Android bluetooth headset playback over SCO mode #122

Open Kravchenko32 opened 1 year ago

Kravchenko32 commented 1 year ago

I have some very particular circumstances, that require Bluetooth SCO mode turned on for mic capture. Long story short, you need to specify "AudioAttributes" for audio playback, otherwise there's no sound.

      .SetAudioAttributes(new Android.Media.AudioAttributes.Builder()
          .SetUsage(Android.Media.AudioUsageKind.VoiceCommunication)
          .Build())

This is an issue for Xamarin Essentials TTS as well (which I haven't reported yet). I'm not even sure how you'd go about handling that. I'm not sure if there's a way for me to configure it globally.

This didn't used to be needed prior to Android 12. However there were reports of audio just stop working after awhile. I think they just made it fail faster.