Teaching a voice to say one word
Meta’s Tai Dam voice reads whole sentences well and single words badly. Getting a clear word out of it took a sentence we throw most of away, two spelling mistakes made on purpose, and a lot of listening.
Cet article n’existe qu’en anglais.
The flashcards on this site have a space for a Listen button, and it is still empty. The right voice for a Tai Dam word is a Tai Dam speaker’s, and recordings are the goal. But I wanted to know how close a machine voice could get in the meantime, and the answer turned out to be a story worth telling: about how these voices work, why one word is harder than a sentence, and how many of my own guesses were wrong.
The whole trick, in one picture
Les chiffres
| part | from (s) | to (s) |
|---|---|---|
| lead-in: Khỏi chếp | 0.016 | 0.416 |
| kept: ꞌnặm | 0.432 | 0.825 |
A voice that learned from sentences
In 2023 Meta published speech voices for more than a thousand languages, Tai Dam among them, as part of its Massively Multilingual Speech project. Each was trained on a recording of the New Testament read aloud. Give the Tai Dam voice a verse in Latin letters and it reads it back so well that Meta’s own speech recogniser writes down 98 letters in every hundred correctly.
Imagine learning a language only from audiobooks. You would know exactly how words flow into each other, where a sentence speeds up and where it slows down to finish. You would never once have heard a word said on its own. That is this voice. For every letter it plans how long to hold it, then paints the sound, with a little randomness each time, so no two takes are quite the same. In a sentence, each word gets a run-up from the one before and a landing from the one after. Alone, a word has neither, and it comes out short, smeared or cut off.
Two letters it couldn’t see
Before the voice could get a word wrong, it had to read it. Twice it didn’t, and said nothing about it.
Tai Dam’s Latin spelling marks one of its two tone series with a small hook before the consonant, ꞌ (a letter of its own, called a saltillo). The voice was trained with a plain apostrophe instead, and it drops any character it doesn’t know, silently. So ꞌnăngꪙꪰ꪿ꪉນັ່ງ‘sit’ came out as năngꪘꪰꪉໜັງ‘skin; bark (of a tree)’.
The letter that fell through
ꞌ dropped without a word
Text in Tai Viet, the traditional Tai Dam script, fared worse: every letter was unknown, so a whole sentence came out as silence. Now the tools I use turn Tai Viet into the Latin spelling first. Both fixes were small. Finding them took listening for something that wasn’t there.
First try: “none of the generated audio is good”
For the flashcards, I tried three voices on fifteen words chosen to cover every tone.
Three voices, fifteen words, one verdict
OmniVoice, reading the Lao spelling
A voice that speaks Lao but not Tai Dam, so it read the words in Lao letters. Three of seventeen clips failed outright, one sounded like music, and the tones were Lao tones.
Wrong tones
Meta’s Tai Dam voice
Clean, and on a pitch track the tones were roughly right. But short words came out short and blurred.
Closest, not close enough
My own voice, cloned
Meta’s voice taught to sound like me, from 119 sentences I recorded on my phone. A steady hiss, and the tones blurred into each other.
Worse than the original
My verdict that night was short: none of the generated audio was good. Some of that wasn’t the voices’ fault. The first clips were saved straight from the model, with no breathing room at either end, so some lost their first sound and others were too quiet to hear. Every clip since has been trimmed, padded with a little silence, faded in and out, and levelled. It was a reminder to check how something was measured before believing the measurement.
The hunch: short is the problem
A few days later, listening to the same fifteen words again, something stood out: the shortest clips were always the worst, and the same word sounded far better in the middle of a longer phrase. So we stopped asking the voice for words, and asked it for sentences instead, keeping only the word we wanted.
That raises a question: where, in a stream of sound, does a word begin? There are no pauses to go by. But the voice already knows, because before it makes a sound, it decides how long to hold every letter. We asked it to tell us.
The voice’s own plan for “Khỏi chếp ꞌnặm”
Les chiffres
| letter | from (s) | to (s) |
|---|---|---|
| k | 0.016 | 0.032 |
| h | 0.048 | 0.064 |
| ỏ | 0.08 | 0.144 |
| i | 0.16 | 0.176 |
| c | 0.24 | 0.272 |
| h | 0.304 | 0.32 |
| ế | 0.352 | 0.384 |
| p | 0.4 | 0.416 |
| ꞌ | 0.48 | 0.512 |
| n | 0.544 | 0.592 |
| ặ | 0.624 | 0.656 |
| m | 0.672 | 0.8 |
Endings: put the word last
The first words we cut out came from the middle of sentences, and they ended badly: the next word starts at once, so the cut lands on a loud sound. My first idea was to keep a few thousandths of a second more, 3 to 5 milliseconds, so the word could trail off. It couldn’t help.
Why a few milliseconds more can’t help
So we put the word last. At the end of a sentence the voice slows down and lets the sound die away, as the reader did in every verse it learned from. It makes the ending for us. Every word since has been the last word of a short sentence, cut out from the gap before it to the point where its sound has faded far below its loudest.
ꞌmứ, ‘hand’, said alone and at the end of a sentence
Les chiffres
| lowest pitch | highest pitch | |
|---|---|---|
| alone | -4.3 | +1.4 |
| end of a sentence | +3.8 | +7.0 |
The word before changes the word
Then came the first real surprise. We were throwing the start of each sentence away, so it shouldn’t have mattered what it said. It did. After Khỏi chếp (“I hurt”), nảꪘ꫁ꪱໜ້າ‘face; front; next’ came out as “fa”, and huaꪬꪺຫົວ‘head’ as “tua”. The lead-in was colouring the word after it.
Think of the lead-in as a run-up. The word we keep takes off from wherever the last sound of the lead-in leaves the voice. So we tried lead-ins ending in different sounds, all in the same frame, “Khỏi … word”, and I scored every clip from 0 (wrong) to 3 (clear).
Fifteen words after three lead-ins
| after hên (see) | after ꞌmí (have) | after chếp (hurt) | |
|---|---|---|---|
| nả | 3 | 1 | 2 |
| ꞌnăng | 0 | 0 | 3 |
| ꞌnặm | 3 | 1 | 3 |
| ꞌnộc | 3 | 1 | 3 |
| ꞌmứ | 2 | 1 | 3 |
| ta | 2 | 1 | 3 |
| bá | 1 | 1 | 3 |
| ꞌpi | 1 | 1 | 3 |
| khảu | 1 | 1 | 3 |
| phắc | 1 | 1 | 3 |
| cáy | 1 | 1 | 3 |
| ꞌcốn | 1 | 1 | 3 |
| ꞌchạng | 1 | 1 | 3 |
| ꞌchẹp | 0 | 1 | 3 |
| hua | 0 | 1 | 0 |
0 wrong1 blurred2 ok3 clear
Les chiffres
| word | after hên (see) | after ꞌmí (have) | after chếp (hurt) |
|---|---|---|---|
| nả | 3 | 1 | 2 |
| ꞌnăng | 0 | 0 | 3 |
| ꞌnặm | 3 | 1 | 3 |
| ꞌnộc | 3 | 1 | 3 |
| ꞌmứ | 2 | 1 | 3 |
| ta | 2 | 1 | 3 |
| bá | 1 | 1 | 3 |
| ꞌpi | 1 | 1 | 3 |
| khảu | 1 | 1 | 3 |
| phắc | 1 | 1 | 3 |
| cáy | 1 | 1 | 3 |
| ꞌcốn | 1 | 1 | 3 |
| ꞌchạng | 1 | 1 | 3 |
| ꞌchẹp | 0 | 1 | 3 |
| hua | 0 | 1 | 0 |
Three more lead-ins
| after kin (eat) | after ꞌdệt (do) | after pák (speak) | |
|---|---|---|---|
| nả | 3 | 3 | 1 |
| ꞌmứ | 1 | 3 | 1 |
| ꞌnặm | 3 | 3 | 1 |
| ta | 1 | 2 | 1 |
| bá | 1 | 3 | 2 |
| ꞌpi | 0 | 0 | 1 |
| khảu | 1 | 3 | 1 |
| phắc | 1 | 3 | 1 |
| cáy | 1 | 1 | 1 |
| ꞌchạng | 0 | 3 | 1 |
0 wrong1 blurred2 ok3 clear
Les chiffres
| word | after kin (eat) | after ꞌdệt (do) | after pák (speak) |
|---|---|---|---|
| nả | 3 | 3 | 1 |
| ꞌmứ | 1 | 3 | 1 |
| ꞌnặm | 3 | 3 | 1 |
| ta | 1 | 2 | 1 |
| bá | 1 | 3 | 2 |
| ꞌpi | 0 | 0 | 1 |
| khảu | 1 | 3 | 1 |
| phắc | 1 | 3 | 1 |
| cáy | 1 | 1 | 1 |
| ꞌchạng | 0 | 3 | 1 |
It wasn’t the kind of sound that mattered so much as the sound itself: p and t gave the word a clean start, k smothered it, and a vowel ran straight into it. My own theory, that an n before an n-word would help, held for a few words and no more.
One roll of the dice
Here is the mis-step I most want to own. Every take is a roll of the dice, and the plan was to make twenty takes of each clip and keep the most typical one. A setting left at 1 in a re-run script meant those lead-in rounds had used a single roll each. The scores were real, but they included luck.
So we made all of it again, twenty takes each, and I scored it again.
Did the first round survive twenty takes?
- 31 the same
- 9 different
Les chiffres
| scores | |
|---|---|
| the same | 31 |
| different | 9 |
The pattern held, with one exception that mattered. I had begun to think Khỏi chếp worked because the voice knew the phrase. With twenty takes, Khỏi ꞌdệt (“I make”) did as well. Neither is magic; both end on a clean stop.
Clear words, by lead-in, over twenty takes
Les chiffres
| lead-in | one take | twenty takes |
|---|---|---|
| chếp | 29 | 24 |
| ꞌdệt | 24 | 26 |
| pák | 11 | 11 |
| hên | 16 | 16 |
The rounds caught me out too. One clip appeared in two of them, and I gave it a 3 the first time and a 0 the second. A single listener is a single listener.
hua, the word that wanted to be alone
One word, huaꪬꪺຫົວ‘head’, was clear after no lead-in at all. With nothing before it, nothing colours its h. But said alone, it was a lottery.
Twenty tries at “hua”
Les chiffres
| take | seconds |
|---|---|
| 1 | 0.6 |
| 2 | 0.36 |
| 3 | 0.38 |
| 4 | 0.52 |
| 5 | 0.25 |
| 6 | 0.25 |
| 7 | 0.31 |
| 8 | 0.28 |
| 9 | 0.41 |
| 10 | 0.3 |
| 11 | 0.22 |
| 12 | 0.31 |
| 13 | 0.23 |
| 14 | 0.27 |
| 15 | 0.32 |
| 16 | 0.27 |
| 17 | 0.22 |
| 18 | 0.19 |
| 19 | 0.38 |
| 20 | 0.36 |
Taking the most typical of eight steadied it, and every take scored a 2: right, but it wanted a breathier h. So we tried holding the h longer, adding randomness, and one other idea: simply writing the h twice.
Making the h breathier
| take 1 | take 2 | |
|---|---|---|
| as the app made it | 2 | 2 |
| h held 1.5× as long | 3 | 2 |
| h held 2× as long | 2 | 3 |
| h held 2.5× as long | 3 | 2 |
| spelt “hhua” | 3 | 3 |
| more randomness | 3 | 3 |
0 wrong1 blurred2 ok3 clear
Les chiffres
| take 1 | take 2 | |
|---|---|---|
| as the app made it | 2 | 2 |
| h held 1.5× as long | 3 | 2 |
| h held 2× as long | 2 | 3 |
| h held 2.5× as long | 3 | 2 |
| spelt “hhua” | 3 | 3 |
| more randomness | 3 | 3 |
ꞌpi, and six wrong consonants
The stubborn one was ꞌpiꪝꪲ꪿ປີ໋່‘older sibling’. After every lead-in it came out wrong, and not wrong in one way.
What I heard instead of ꞌpi
ꞌpi
heard instead
- di
- thi
- gi
- ti
- bi
- vi
Six different consonants for one word means the voice isn’t sure what it is meant to say. It seems to have learned the hooked ꞌd well and the hooked ꞌp hardly at all. So we tried spelling it other ways.
Five ways to write ꞌpi, after two lead-ins
| chếp · 0 | chếp · 1 | ꞌdệt · 0 | ꞌdệt · 1 | |
|---|---|---|---|---|
| ꞌpi, as written | 0 | 0 | 0 | 0 |
| pi, no ꞌ | 0 | 0 | 3 | 3 |
| ꞌppi, p twice | 0 | 0 | 2 | 2 |
| ꞌpi, p held 2× | 0 | 0 | 0 | 0 |
| ꞌpi, p held 3× | 0 | 0 | 0 | 0 |
0 wrong1 blurred2 ok3 clear
Les chiffres
| chếp · 0 | chếp · 1 | ꞌdệt · 0 | ꞌdệt · 1 | |
|---|---|---|---|---|
| ꞌpi, as written | 0 (di/thi) | 0 (ti) | 0 (bi) | 0 (vi) |
| pi, no ꞌ | 0 (gi) | 0 (thi) | 3 (pi) | 3 (pi) |
| ꞌppi, p twice | 0 (gi) | 0 (gi/ki) | 2 (pi) | 2 (pi) |
| ꞌpi, p held 2× | 0 (thi) | 0 (ki) | 0 (mi) | 0 (mi) |
| ꞌpi, p held 3× | 0 (ki) | 0 (di) | 0 (bi) | 0 (bi) |
Plain “pi” after ꞌdệt was then clear on eight takes out of eight. There is a small joke in that. I have always said ꞌdệt as “het”, the way the word is said in Lao; it is “yet” in Tai Dam. The lead-in I couldn’t say properly became the one that fixed the word.
Khỏi ꞌdệt ꞌpi heard as “bi” (faux) Khỏi ꞌdệt pi clear (juste)
Trying vowel and nasal lead-ins taught one more thing. Notes like “o-thi” and “ut-thi” were the end of the lead-in leaking in: after a vowel there is no gap before the next word, so a cut made halfway through the gap starts inside the lead-in. Both lead-ins we kept end in a stop, which always leaves a gap.
Slower is clearer
Even fixed, pi ended a little abruptly. We tried cutting later, or not cutting the end at all, and it made no difference: the voice itself was clipping the i. Saying the whole sentence 15% slower did. It fixed pi, and lifted the whole set.
The app’s four takes of each word, before and after slowing down
Les chiffres
| clear takes | words with a clear take | |
|---|---|---|
| normal speed | 39 of 60 | 13 of 15 |
| 15% slower | 44 of 59 | 15 of 15 |
That round also showed that some first sounds clash with a lead-in. Words starting with c only worked after chếp, and words starting with ch only after ꞌdệt.
First sounds that clash
| after chếp | after ꞌdệt | |
|---|---|---|
| c (cáy, ꞌcốn) | 7 of 8 | 0 of 8 |
| ch (ꞌchạng, ꞌchẹp) | 2 of 8 | 8 of 8 |
Les chiffres
| after chếp | after ꞌdệt | |
|---|---|---|
| c (cáy, ꞌcốn) | 7 of 8 | 0 of 8 |
| ch (ꞌchạng, ꞌchẹp) | 2 of 8 | 8 of 8 |
The recipe
Put together, a single Tai Dam word is now made like this, decided by the sound it starts with:
How a word is said, by its first sound
- Starts with h hua Said alone, with the h written twice “hhua”; each take the most typical of eight
- Starts with p ꞌpi After “Khỏi ꞌdệt”, without the hook said as “Khỏi ꞌdệt pi”
- Starts with ch ꞌchạng After “Khỏi ꞌdệt” only
- Starts with c cáy After “Khỏi chếp” only
- Anything else ta, khảu, ꞌnăng Two takes after each lead-in “Khỏi chếp …” and “Khỏi ꞌdệt …”
That last line matters most. No rule gets every take right; the voice is random, and some words (nả among them) are clear in two takes of four and wrong in the others. So the tool doesn’t pick. It offers four, and someone who knows the word chooses.
Two judges, and two clones
A machine can transcribe speech, so why not let it score the clips? We tried. Meta’s recogniser reads whole sentences well, but on single words it was nearly useless.
The machine judge
Les chiffres
| words matched (of 15) | |
|---|---|
| said alone | 0 |
| cut from mid-sentence | 2 |
| cut from the end | 2 |
So the ear decided everything here. It also settled the question of my own voice. I had trained two clones of it, one on 119 recordings and one on 183. Meta’s original beat them in about nine comparisons in ten, and both clones made a mess of any sentence they hadn’t been trained on. Cloning a voice well needs far more recordings than that.
Where this leaves the flashcards
With these rules, the tool has made four takes of every one of the 594 words and phrases on this site: 2,376 clips to listen through and choose from. None is on the site yet.
Some honest limits. All of this rests on one listener, me, and on fifteen words. The sentences were put together from patterns in the dictionary, and no fluent speaker has checked them or the tones. Each rule comes from one or two words. And the best Tai Dam voice is still a person’s. If you speak Tai Dam and would like to record words for the site, or you hear something wrong here, I would love to hear from you.
The voice is Meta’s MMS text-to-speech voice for Tai Dam, facebook/mms-tts-blt, published under the Creative Commons Attribution-NonCommercial 4.0 licence; the clips on this page were made with it. The scripts and the tool were written with the help of an AI coding assistant; the listening was mine.