phonemizer
phonemizer copied to clipboard
Parse espeak -X Flag for word to phoneme word mappings
What does this PR do? This PR introduces the new return_word_mappings parameter to the phonemize function to enable text to phoneme mappings for espeak backend only. In-turn when setting this value to True, appends the -X flag to espeak which prints out the mappings. See espeak PR here (coming soon).
What did you do?
- Added parameter return_word_mappings
- If return_word_mappings is true, append -X flag to espeak
- If return_word_mappings is true, parse -X flag output
- If return_word_mappings is true, return phonemized text and phoneme mappings, else just return phonemized text.
How did you test?
- Through the python console
- Modified resembletron's call to phonemize inside the synthesis.py#prepare_symbol_seqs_with_ssml function (added in Resembletrons PR #245)
What should the reviewer look out for? Nothing.