capacitor-community / text-to-speech

⚡️ Capacitor plugin for synthesizing speech from text.
MIT License
96 stars 27 forks source link

fix(ios)!: linear rate adjustment #136

Closed dwassmer closed 1 week ago

dwassmer commented 1 week ago

Closes: https://github.com/capacitor-community/text-to-speech/issues/134

Changes iOS rate mapping from rateAdjustment-before to a more predictable mapping rateAdjustment-after (x-axis = plugin speech rate, y-axis = native speech rate, assuming AVSpeechUtteranceDefaultSpeechRate is 0.5)

Note: Speech rate heavily depends on the selected tts-engine and voice. There will not be a perfect cross-platform speech rate match. From experimenting with android and iOS tts-engines and voices this adjustment seems to be a good compromise. We should also consider removing the rate adjustment completely though. See a similar discussion on react-native-tts here. But that is another discussion.

Pull request checklist

Please check if your PR fulfills the following requirements: