- Thanks to Thorsten Mueller for this helpful tutorial which gives tips on how to add custom pronunciation rules to
espeak-ng, whichpiperrelies on. - If you notice that words aren't being pronounced correctly even when they are recorded correctly in your audio dataset, it is likely because the phonemes supplied by
espeak-ngwere incorrect when your model was trained. - Custom pronunciation rules must be applied before you train your model. You will need to retrain your model if you want to change its pronunciation later. Spending some time getting your pronunciation figured out before training a lot of voices is highly recommended.
- Clone the espeak-ng git repo to get the files you will need to modify:
git clone https://github.com/espeak-ng/espeak-ng - For whichever language(s) you are using, you will need 3 dictionary source files from
espeak-ng/dictsource(substitute the language code of the language you are modifying forxx):
xx_listxx_rulesxx_emojixx_extra- this file is not supplied, it is a plain text file that you must create yourself (see below)
- Each line in
xx_extrabegins with the text to be pronounced, followed by the pronunciation as represented in Kirschenbaum format (Also known as ASCII-IPA or erkIPA format).
#en_extra file format example
Noella no'El:V O
- I have created an IPA to kirschenbaum cheatsheet which may be a useful starting point for people who know the international phonetic alphabet.
D34DC3N73R reported having great success converting IPA to Kirschenbaum / ASCII IPA using an LLM.
They also had very good results using an LLM to generate custom pronunciations (ie en_extra file entries) for specific accents.
I haven't tried it yet but this looks like a very promising option.
I am developing a New York accent voice model for Piper,
which utilizes eSpeak-NG as its phoneme synthesis engine.
Provide a list of the 100 words most likely to be mispronounced
by eSpeak-NG due to the distinct features of the New York accent.
Display each word in a list with its Kirschenbaum (ASCII-IPA)
conversion format, as shown in these examples:
garage g@'rA:Z
smart smA:rt
sabotage sab@,tA:3
Do not include any explanations or additional text within the list itself.
Here is a list of the top 100 words most likely to be mispronounced by eSpeak-NG in a New York accent,
presented in Kirschenbaum (ASCII-IPA) format without explanations:
coffee k'A:fi
water w'A:t@
dog dA:g
talk tA:k
call kA:l
car kA:
park pA:k
sure S@
door dO:
floor flO:
long lA:Ng
island 'A:l@nd
thought TA:t
etc...
Espeak-ngis preinstalled in thetextymcspeechy-piperdocker image. The commands to compile pronunciation must be run as root within the docker container, and must be run every time the container starts.- There are scripts for both manually and automatically activating your custom pronunciations provided. Instructions for these are found here.
- Compile the new pronunciation rule to make it active.
# IMPORTANT- run this from the directory where xx_list, xx_rules, xx_emoji, and xx_extra are located.
sudo espeak-ng --compile=xx # <--- where xx is the 2 letter language code.
- Test the new pronunciation, eg
espeak-ng "Testing the corrected pronunciation of Noella" --ipa
espeak-ng -v ja "ピクルス" --ipa
espeak-ng -v ru "Пожалуйста" --ipa
- Changes to espeak-ng's pronunciation rules are applied system-wide on non-containerized installs and only have to be applied once. If you need to undo your custom pronunciations, revise or delete
xx_extraand compile your rules again as above.