phonemizer icon indicating copy to clipboard operation
phonemizer copied to clipboard

Parse espeak -X Flag for word to phoneme word mappings

Open TediPapajorgji opened this issue 4 years ago • 0 comments

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.

TediPapajorgji avatar Apr 14 '20 19:04 TediPapajorgji