How is pronunciation decided?
Homographs like "wind" have different meaning and pronunciation depending on the context, but same spelling. For example "wind power" vs "wind a clock". How is this pronunciation decided in such cases?
It is pronouncing the "wind" in "wind power" the wrong way - the way it would be pronounced in "wind a clock". Strangely, it gets it right for the default voices, but wrong when I trained a new English voice.
More of a banaid use the EN-BR and it sounds better. The EN-US says wine'd power noticeably. but MeloTTS has g2p-en doing the pronunciation as far as I can tell. for me it is loacted in my conda envirnment.. /home/user/anaconda3/envs/melotts/lib/python3.10/site-packages/g2p_en.
Test the current Pronunciation out got to terminal or your your go code runner, and type python and enter and run each one of these.
from g2p_en import G2p
g2p = G2p()
word = "wind"
phonemes = g2p(word)
print(f"Phonemes for '{word}': {phonemes}")`
Phonemes for 'wind': ['W', 'AY1', 'N', 'D']
after you find what you need edit the homo file
nano homographs.en add something like this to the list
WIND|W IH1 N D|W AY1 N D|N
that should get you started on the first half at least
One issue is that the code currently calls g2p() separately for each word. The G2p package can lookup the word in the dictionary or guess a pronunciation if it is not in the dictionary. But this doesn't allow G2p to figure out the part of speech to do disambiguation. The W IH1 N D versus W AY1 N D can be distinguished based on noun/verb, so changing MeloTTS to call g2p() on the full text would fix this specific problem.
There are other cases in English where the part of speech (noun/verb/etc.) is not enough to distinguish pronunciations. A full solution is to train another DL model to go from text to phonemes. A recent model I found is SoundChoice 1 which has Apache-2.0 licensed weights available 2. Swapping in a model like this would be a more full-featured fix. But playing around with SoundChoice shows it isn't perfect, either. It doesn't get, "You wind a bobbin but the wind blows."