3

since iOS 16 update my vocabulary app (PWA) has problems with spelling provided text to SpeechSynthesisUtterance object. It doesn't apply to all languages, eg. Russian sounds the same like before update to iOS 16. If it comes to German or English - the quality is very low, muffled, the voice sounds nasal... For MacOS Safari everything works as supposed to, but not for iOS 16.

const fullPhrase = toFullPhrase(props.phrase);
const utterance = new SpeechSynthesisUtterance();

onMounted(() => { // Vue lifecycle method
  utterance.text = fullPhrase;
  utterance.lang = voice.value.lang;
  utterance.voice = voice.value;
  utterance.addEventListener(ON_SPEAK_END, toggleSpeakStatus);
});

I tried to modify pitch and rate properties but without success... Did they change API for SpeechSynthesis / SpeechSynthesisUtterance for Safari in iOS 16 maybe?

chudy91
  • 408
  • 3
  • 18

2 Answers2

2

iOS 16 seems to have completely messed up voices for speechSynthesis.getVoices() at least for en-US lang. Before iOS 16, it used to display only two voices for en-US: Fred and Samantha. Regardless if you chose Fred or Samantha it would always use Samantha. Now, iOS 16 displays a bunch of new voices but none of them are the good sounding voices found in in Settings > Accessibility > VoiceOver > Speech > Voice. And "Samantha" is missing from getVoices(). Apple needs to fix this.

As a workaround you can get speechSynthesis.speak(utterance) to use "Samantha" or possibly what is default for the phone by not setting a voice with utterance.voice.

Jeff Baker
  • 1,492
  • 1
  • 12
  • 15
1

It looks like IO16 introduced a lot of new (sometimes very weird) voices for en-GB and en-US. In my case I was looking for a voice only by a lang and taking the first one. As a result I was getting a strange voice.

  • You're right. I had to hardcode iOS voice names ('Daniel' for 'en-GB', 'Anna' for 'de-DE') and search for these voices specifically. Russian sounds OK because it has only one available (good) voice. Using the first found voice for EN/DE gives terrible result. – chudy91 Dec 24 '22 at 22:09
  • @chudy91 I try to "hardcode" Anna for 'de-DE' but it's even not listed, although installed and available on the Accessibility page and system-level voice over. How is this available on your system? – Jankapunkt Jun 19 '23 at 08:27