I have a Xamarin Forms app that uses text to speech. The code in the iOS project is exactly the same as on the official Xamarin Implementing Text To Speech guide
var speechSynthesizer = new AVSpeechSynthesizer ();
var speechUtterance = new AVSpeechUtterance (text) {
Rate = AVSpeechUtterance.MaximumSpeechRate/4,
Voice = AVSpeechSynthesisVoice.FromLanguage ("en-US"),
Volume = 0.5f,
PitchMultiplier = 1.0f
};
speechSynthesizer.SpeakUtterance (speechUtterance);
This works great in the iOS emulator but when I deploy to my iPad running iOS 10.2.1 I only hear any sound if I put headphones on. I've turned the volume right up and still nothing without headphones, if I do use headphones though it's very loud so implies it's not just too quiet. Other apps play audio fine through my iPad speaker so I don't think it's a hardware issue.
I've also tried using this plugin (https://github.com/jamesmontemagno/TextToSpeechPlugin) for text to speech but it has the exact same issue when I deploy to the device.
Is there any reason this would work with headphones but fail when no headphones are plugged in?