ak1394 / react-native-tts

React Native Text-To-Speech library for Android and iOS
601 stars 154 forks source link

Is there a way to teach this library proper pronunciation? #249

Closed tfuda closed 10 months ago

tfuda commented 10 months ago

Here's an interesting problem; I'm building mobile app that runs on Android and iOS. It speaks the name of fish species. It all seems to go well until it has to say "striped bass" (soft a, not hard a, like base, as in bass guitar). On Android, it speaks the name correctly. On iOS, it says "striped base" (sounds like the guitar). I tried doing a string replace of "bass" with "baas" but that doesn't really sound correct either. Any thoughts on how to make it pronounce a heteronym like this correctly, based on the context in which it is used?

tfuda commented 10 months ago

I came up with a brute force workaround; string replace "bass" with "basss" before calling Tts.speak. :-)