AI Compass
Compass

Speech synthesis

From text to voice: how current systems sound, what voice cloning means technically, and which labelling duties apply.

·3 min read·By Fachredaktion Technik
DETAIL
3 sections

The idea

Text is first translated into phonetics and stress, from that a time-frequency image is produced, and from that image a second model generates the sound wave. The split into two stages is why voice, delivery and content can be steered separately.

What it is good for

  • Read-aloud for documents and accessibility.
  • Announcements and voice dialogues.
  • Training material and subtitling.
  • Multilingual versions without a new recording.

The structure

  1. 01

    Text normalisation

    Spell out numbers, abbreviations and dates. "§ 3 para. 2" must become "section three paragraph two".

  2. 02

    Phonetics

    Conversion to phonemes, with a dictionary for names and technical terms.

  3. 03

    Acoustic model

    Produces a mel spectrogram with duration and stress.

  4. 04

    Vocoder

    Produces the actual waveform from the spectrogram.

The first stage is routinely underestimated and causes most audible errors. An amount like "1,250.50 EUR" has to become "one thousand two hundred and fifty euros fifty", and a wrong rule for that is obvious to every listener.

What drives quality

FactorEffect
Text normalisationvery large, the most common source of errors
Pronunciation dictionarylarge for technical text
Stress and pauseslarge for intelligibility
Vocoder qualitymedium, usually sufficient today
Sample ratesmall above 22 kHz

Voice cloning, technically

Two routes with very different effort:

RouteMaterialEffortQuality
Speaker embedding3 to 30 secondsno adaptation neededrecognisable, not perfect
Fine-tuning10 minutes to hourstraining requiredvery close to the original

In the first, an encoder turns a short sample into a vector describing the voice, and that vector steers the synthesis. It is exactly the idea behind image embeddings, see Embeddings.

Computed: the mel scale and the real-time factor

Speech synthesis almost never produces a waveform directly. It produces a mel spectrogram first. The mel scale maps frequencies the way the ear resolves them: finely at the bottom, coarsely at the top.

Mel scale

m(f) = 2595 · log₁₀(1 + f / 700)

Mel pitch is the logarithm of the frequency shifted by 700 hertz, scaled by 2595.

m
pitch in mel
f
frequency in hertz
2595
scaling constant of the common approximation

At 1,000 Hz this gives 2595 · log₁₀(2.4286) ≈ 1000 mel. At 2,000 Hz it gives 2595 · log₁₀(3.8571) ≈ 1521 mel. Twice the frequency is therefore not twice the perceived pitch, which is exactly why the computation happens in mel.

A typical mel spectrogram uses 80 bands at a hop of 256 samples and a sample rate of 22,050 Hz. That yields 22050 / 256 ≈ 86 frames per second. One second of speech is therefore a matrix of 80 × 86 = 6,880 numbers the model has to produce.

Real-time factor

RTF = t_synth / t_audio

The real-time factor is compute time divided by the length of the audio produced; below one means faster than real time.

RTF
real-time factor
t_synth
synthesis compute time in seconds
t_audio
length of the generated signal in seconds

A model that produces 10 seconds of speech in 0.4 seconds has an RTF of 0.04. For a dialogue system, though, what counts is not RTF but time to first audio. Computing the whole sentence before speaking is noticeably slow; generating and emitting in chunks is not.

Labelling

  • Provider duty. Outputs must be marked machine-readably as artificially generated, for instance by a watermark in the signal or metadata.
  • Deployer duty. Anyone imitating a voice and publishing it must disclose that. Exceptions exist for obviously artistic or satirical works, with limits.
  • Dialogue systems. Anyone speaking to a system must be able to tell it is not a person. That duty applies regardless of voice quality.
  • Documentation. Consent of the voice provider, scope of use, revocation route and deletion of the voice data belong in writing.

Watermarking

Methods embedding an inaudible marker in the generated signal exist and are used by several providers. Their limits are known:

  • They survive light compression but not every kind of post-processing.
  • They prove origin from a particular system, not the absence of manipulation.
  • They help with cooperative providers, not with deliberate misuse.

In practice a watermark is a duty-of-care measure, not protection. Organisational safeguards such as call-back procedures for payment instructions are more effective against voice fraud than any technical detection.

Related courses and sources

CourseFree1200 minEN

Hugging Face audio course

From the signal through spectrograms to recognition and synthesis, with code throughout. The practical companion to the speech and audio articles.

For anyone building speech technology themselves; assumes Python and some signal knowledge.

Hugging FaceGo to offer
Was this page helpful?
Speech synthesis