mklement0 / speak.awf

An Alfred 3 workflow that uses macOS's TTS (text-to-speech) feature to speak text aloud.
36 stars 2 forks source link

Speaking rate possible via embedded speech commands #2

Closed jmmitchell closed 3 years ago

jmmitchell commented 3 years ago

In the comments of the say-it bash script, it is noted that as of OSX 10.11 the say command doesn't respect custom speaking rates. I noted that apple supports other methods of indicating the speed via embedded speech commands. You might want to look into them as another method of specifying the rate.

StackExchange discussion

Apple Dev: Techniques for Customizing Synthesized Speech

mklement0 commented 3 years ago

Thanks for the pointers, @jmmitchell.

What the comment in say-it is trying to say is that say doesn't respect custom speaking rates if you use the -v option to target a voice explicitly.

E.g., if you've set rate 100 for voice Alex via System Preferences and Alex is the default voice, say 'Hello' will honor the rate, but say -v Alex 'Hello' will not.

say-it compensates for that by reading the custom rates from configuration and applying them explicitly, via -r <rate> when say is invoked behind the scenes.