nvidia-riva / python-clients

Riva Python client API and CLI utils
MIT License
62 stars 20 forks source link

Add custom dictionary parameter to tts py-client #82

Closed manishaj-nv closed 2 weeks ago

manishaj-nv commented 2 months ago

This pull request introduces a addition of custom grapheme-to-phoneme dictionary for the Riva TTS client. The custom dictionary takes precedence over the default grapheme-to-phoneme rules and if a word is present in both the custom dictionary and the default rules, the custom mapping will be used.

Ensure custom handling of the dictionary is handled in the client end and is of the format key. Read textFile and pass as string of the format to the API "ARON ˈdʒɑnsən,AARON ˈdʒɑnsən"

Usage To use, pass the --user-dictionary flag with the path to your dictionary file when running the riva_tts_client

Example: python3 riva/client/talk.py --text=" Hi Aaron, this is speech synthesizer" --audio_file=/opt/riva/riva-speech/output.wav --user_dictionary=

rmittal-github commented 1 month ago

Logic looks fine, apart from minor comments. Need to test CI with all changes after handling review comments.