Apprendre le tai dam

Blog

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

The voice says a short sentence, “Khỏi chếp ꞌnặm”, and we keep only its last word, ꞌnặm, ‘water’. Everything before the scissors is thrown away. This take scored a 3: clear.
Les chiffres
partfrom (s)to (s)
lead-in: Khỏi chếp0.0160.416
kept: ꞌnặm0.4320.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

Typed ꞌnăng ‘sit’
What the voice read năng ‘skin’

ꞌ dropped without a word

The voice skips any character it wasn’t trained on, without a warning. The fix is to hand it the apostrophe it learned.

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”

lead-inthe word we keepkhỏichếpꞌnặmcut here800 ms
Each block is one letter, as long as the voice plans to hold it, in steps of 16 thousandths of a second. The cut goes halfway through the gap before the word we want.
Les chiffres
letterfrom (s)to (s)
k0.0160.032
h0.0480.064
ỏ0.080.144
i0.160.176
c0.240.272
h0.3040.32
ế0.3520.384
p0.40.416
ꞌ0.480.512
n0.5440.592
ặ0.6240.656
m0.6720.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

16 ms: one step of the voice← 3–5 ms
The voice works in steps of 16 ms. Three to five milliseconds is a sliver of one step, and mid-sentence the next word is already under way.

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

-404800.10.20.3time from the start of the word (s)semitonesaloneend of a sentence

Said alone ꞌmứ At a sentence’s end ꞌmứ (juste)

Pitch over time, in semitones above or below the voice’s usual level. ꞌmứ has a high, level tone. Said alone, it starts low and wanders up; at the end of a sentence it sits high and steady, as it should.
Les chiffres
lowest pitchhighest 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ả312
ꞌnăng003
ꞌnặm313
ꞌnộc313
ꞌmứ213
ta213
bá113
ꞌpi113
khảu113
phắc113
cáy113
ꞌcốn113
ꞌchạng113
ꞌchẹp013
hua010

0 wrong1 blurred2 ok3 clear

hên ends in n, ꞌmí in a vowel, chếp in p. The lead-in ending in a vowel blurred nearly everything.
Les chiffres
wordafter hên (see)after ꞌmí (have)after chếp (hurt)
nả312
ꞌnăng003
ꞌnặm313
ꞌnộc313
ꞌmứ213
ta213
bá113
ꞌpi113
khảu113
phắc113
cáy113
ꞌcốn113
ꞌchạng113
ꞌchẹp013
hua010

Three more lead-ins

after kin (eat)after ꞌdệt (do)after pák (speak)
nả331
ꞌmứ131
ꞌnặm331
ta121
bá132
ꞌpi001
khảu131
phắc131
cáy111
ꞌchạng031

0 wrong1 blurred2 ok3 clear

kin ends in n, ꞌdệt in t, pák in k. A t worked as well as a p; a k worked for nothing.
Les chiffres
wordafter kin (eat)after ꞌdệt (do)after pák (speak)
nả331
ꞌmứ131
ꞌnặm331
ta121
bá132
ꞌpi001
khảu131
phắc131
cáy111
ꞌchạng031

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
Each square is one of the forty scores from the lead-in rounds. Most came out the same with twenty takes as with one.
Les chiffres
scores
the same31
different9

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

  • chếpone take: 29 24
  • ꞌdệtone take: 24 26
  • pákone take: 11 11
  • hênone take: 16 16
Points out of 30, over ten words. The two that end in a stop lead; the one that ends in k is left behind.
Les chiffres
lead-inone taketwenty takes
chếp2924
ꞌdệt2426
pák1111
hên1616

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”

0.1 s0.2 s0.3 s0.4 s0.5 s0.6 smost typical

The shortest take 0.19 s The longest take 0.60 s

Each dot is one take of hua said alone, by how long the speech lasts: the same word and the same settings, with a threefold spread. Taking the most typical steadies it; the app makes eight and keeps the one nearest the middle.
Les chiffres
takeseconds
10.6
20.36
30.38
40.52
50.25
60.25
70.31
80.28
90.41
100.3
110.22
120.31
130.23
140.27
150.32
160.27
170.22
180.19
190.38
200.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 1take 2
as the app made it22
h held 1.5× as long32
h held 2× as long23
h held 2.5× as long32
spelt “hhua”33
more randomness33

0 wrong1 blurred2 ok3 clear

hua most typical of 8 hhua the h written twice (juste)

Two takes of each. Spelling it “hhua” was clear both times, and needs nothing from the voice but a different spelling.
Les chiffres
take 1take 2
as the app made it22
h held 1.5× as long32
h held 2× as long23
h held 2.5× as long32
spelt “hhua”33
more randomness33

ꞌ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 · 0chếp · 1ꞌdệt · 0ꞌdệt · 1
ꞌpi, as written0000
pi, no ꞌ0033
ꞌppi, p twice0022
ꞌpi, p held 2×0000
ꞌpi, p held 3×0000

0 wrong1 blurred2 ok3 clear

Two takes each. Only one spelling after one lead-in was clear: plain “pi”, without the hook, after ꞌdệt. To my ear it sounds the same as ꞌpi.
Les chiffres
chếp · 0chếp · 1ꞌdệt · 0ꞌdệt · 1
ꞌpi, as written0 (di/thi)0 (ti)0 (bi)0 (vi)
pi, no ꞌ0 (gi)0 (thi)3 (pi)3 (pi)
ꞌppi, p twice0 (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

  • normal speed39 of 60 takes; 13 of 15 words 65%
  • 15% slower44 of 59 takes; 15 of 15 words 75%
Clear takes out of all the takes of the fifteen words, and how many words had at least one clear take.
Les chiffres
clear takeswords with a clear take
normal speed39 of 6013 of 15
15% slower44 of 5915 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ếpafter ꞌdệt
c (cáy, ꞌcốn)7 of 80 of 8
ch (ꞌchạng, ꞌchẹp)2 of 88 of 8
Clear takes, over both rounds made in the app.
Les chiffres
after chếpafter ꞌdệt
c (cáy, ꞌcốn)7 of 80 of 8
ch (ꞌchạng, ꞌchẹp)2 of 88 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

  1. Starts with h hua Said alone, with the h written twice “hhua”; each take the most typical of eight
  2. Starts with p ꞌpi After “Khỏi ꞌdệt”, without the hook said as “Khỏi ꞌdệt pi”
  3. Starts with ch ꞌchạng After “Khỏi ꞌdệt” only
  4. Starts with c cáy After “Khỏi chếp” only
  5. 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

  • said alone 0 of 15
  • cut from mid-sentence 2 of 15
  • cut from the end 2 of 15
Of the fifteen words, how many Meta’s recogniser wrote down exactly, for each way of saying them. It was trained on much the same recordings as the voice, so it forgives exactly the mistakes we needed it to catch.
Les chiffres
words matched (of 15)
said alone0
cut from mid-sentence2
cut from the end2

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.