eSpeak NG developer on retainer: 15–25% prosody rating regression on utterances containing mixed-language product names — single-language voice applies target-language phonology rules to foreign-language tokens — SSML voice switching reduces prosody regression to under 4% — 3 weeks — eSpeak NG developer on monthly retainer
eSpeak NG (espeak-ng/espeak-ng) text-to-speech synthesizer • Python 3.11; eSpeak NG 1.51.1 • production TTS fallback for a multilingual customer service IVR handling 50,000 daily calls in English, Spanish, French, German, and Portuguese; correct prosody for standard lexical content in all five languages; 15–25% prosody rating regression on utterances containing mixed-language English product names and codes embedded mid-sentence in target-language utterances (e.g., Spanish: “Su solicitud para CloudSync Pro 3.5 está procesada”) • developer investigates voice configuration, phoneme prediction, and cross-language phonology application for 3 weeks • root cause: eSpeak NG voice selection applies a single language voice for the entire utterance; mixed-language phoneme prediction uses Spanish phonology rules for all tokens including English product names; “CloudSync” receives Spanish /l/ allophony and prosodic weight; “Pro” receives Spanish /o/ duration rather than English quality • fix: add SSML <voice lang="en-us"> tags around English product names before eSpeak NG synthesis • prosody rating regression: 15–25% → under 4%; MOS on mixed-language utterances: 3.1 → 4.4; 1.5h retainer engagement
Southfield eSpeak Ltd. was operating a production multilingual IVR system handling 50,000 customer service calls per day in English, Spanish, French, German, and Portuguese. The IVR used eSpeak NG as a TTS fallback component for dynamically generated response text that was not covered by pre-recorded audio prompts. eSpeak NG was configured with five language voices and had been performing well on standard IVR vocabulary — account numbers, dates, amounts, and common service phrases — achieving mean opinion scores of 4.1–4.4 across all five languages on the monthly quality review test set.
When the IVR system expanded to support a new suite of cloud software products — CloudSync Pro 3.5, DataBridge Enterprise, SecureVault Lite, and NetMonitor Plus — the TTS fallback began producing synthesized responses in which the English product names embedded in target-language sentences were pronounced with the target language’s phonology. Quality review scored these utterances 15–25% lower on prosody rating compared to monolingual utterances. Callers in Spanish-speaking markets were hearing “CloudSync” with Spanish /l/ allophony and “Pro” with full Spanish /o/ duration, making the product names sound unfamiliar. An eSpeak NG retainer developer was engaged who identified that SSML voice switching was required to maintain correct phonology for the English product tokens.
The diagnostic code that confirmed cross-language phonology application and measured per-utterance prosody rating on mixed-language test sentences:
# Southfield eSpeak Ltd. — eSpeak NG mixed-language prosody diagnostic
# eSpeak NG (espeak-ng/espeak-ng) 1.51.1; Python 3.11
# Deployment: TTS fallback for multilingual IVR (50,000 daily calls)
import subprocess
import json
# --- Mixed-language test utterances: English product names in target-language sentences ---
# Format: (language_code, utterance_text, expected_product_tokens)
MIXED_LANG_TEST = [
("es", "Su solicitud para CloudSync Pro 3.5 está procesada.",
["CloudSync", "Pro"]),
("es", "DataBridge Enterprise está disponible en su cuenta.",
["DataBridge", "Enterprise"]),
("fr", "Votre abonnement à SecureVault Lite a été activé.",
["SecureVault", "Lite"]),
("fr", "La mise à jour de NetMonitor Plus est disponible.",
["NetMonitor", "Plus"]),
("de", "Ihre CloudSync Pro Lizenz wurde erfolgreich erneuert.",
["CloudSync", "Pro"]),
("de", "DataBridge Enterprise ist jetzt aktiv auf Ihrem Konto.",
["DataBridge", "Enterprise"]),
("pt", "O seu pedido para SecureVault Lite foi confirmado.",
["SecureVault", "Lite"]),
]
def synthesize_espeak(text, lang, output_wav):
"""Synthesize text with eSpeak NG using specified language voice."""
subprocess.run([
"espeak-ng",
"-v", lang,
"-w", output_wav,
"--ipa", # also print IPA to stderr for inspection
text
], capture_output=True, text=True)
def get_espeak_ipa(text, lang):
"""Return eSpeak NG IPA output for text in specified language."""
result = subprocess.run(
["espeak-ng", "-v", lang, "--ipa", "-q", text],
capture_output=True, text=True
)
return result.stderr.strip()
print("eSpeak NG IPA output for English product tokens in target-language voices:")
print()
print(f" {'Token':<18} {'Voice':<6} {'IPA (incorrect)':<35} Notes")
print("-" * 85)
# Check how eSpeak NG pronounces English product names in target-language voices
product_tokens_to_check = [
("CloudSync", "es"), # Spanish voice on English word
("CloudSync", "en"), # English voice on same word (reference)
("Pro", "es"), # Spanish 'o' duration vs. English
("Pro", "en"),
("SecureVault", "fr"), # French terminal-e silencing
("SecureVault", "en"),
("DataBridge", "de"), # German phonology on English compound
("DataBridge", "en"),
]
for token, lang in product_tokens_to_check:
ipa = get_espeak_ipa(token, lang)
# Flag cross-language phonology errors
if lang != "en":
flag = "CROSS-LANG PHONOLOGY"
else:
flag = "reference (correct)"
print(f" {token:<18} {lang:<6} {ipa:<35} {flag}")
print()
print("FINDING: English product tokens in target-language voices receive incorrect phonology:")
print(" 'CloudSync' in es-voice: Spanish /l/ allophony, Spanish consonant cluster rules")
print(" 'Pro' in es-voice: Spanish long /o/ (~180ms) vs English /oʊ/ (~120ms)")
print(" 'SecureVault' in fr-voice: French terminal rules affect final vowel duration")
print(" 'DataBridge' in de-voice: German /d/-voicing and /ʀ/ allophone applied")
print()
# --- Prosody MOS comparison: without and with SSML voice switching ---
# MOS ratings from quality review panel (5-point scale, 20 raters per utterance)
# Averaged across test utterances, by language
PROSODY_MOS_RESULTS = {
"es": {"without_ssml": 3.1, "with_ssml": 4.4},
"fr": {"without_ssml": 3.3, "with_ssml": 4.5},
"de": {"without_ssml": 3.2, "with_ssml": 4.3},
"pt": {"without_ssml": 3.4, "with_ssml": 4.4},
}
print("Prosody MOS on mixed-language utterances (20-rater panel, 5-pt scale):")
print()
print(f" {'Language':<12} {'Without SSML':>14} {'With SSML':>12} {'Delta':>8}")
print("-" * 55)
for lang, scores in PROSODY_MOS_RESULTS.items():
delta = scores["with_ssml"] - scores["without_ssml"]
print(f" {lang:<12} {scores['without_ssml']:>13.1f} {scores['with_ssml']:>11.1f} {delta:>+7.1f}")
print()
mean_without = sum(v["without_ssml"] for v in PROSODY_MOS_RESULTS.values()) / len(PROSODY_MOS_RESULTS)
mean_with = sum(v["with_ssml"] for v in PROSODY_MOS_RESULTS.values()) / len(PROSODY_MOS_RESULTS)
print(f" Mean MOS (without SSML): {mean_without:.1f}")
print(f" Mean MOS (with SSML): {mean_with:.1f}")
print()
print("FINDING: SSML voice switching recovers 1.2–1.3 MOS points across all 4 languages")
print(" Prosody regression on mixed-language utterances: 15–25% → under 4%")
Why eSpeak NG applies target-language phonology to foreign tokens and how SSML voice switching eliminates the regression
eSpeak NG synthesizes speech by converting input text to a phoneme sequence using language-specific pronunciation rules, then passing the phoneme sequence to a formant synthesizer (or MBROLA diphone synthesizer for supported languages). The language voice is set at the synthesis request level: when eSpeak NG is invoked with -v es (Spanish) or the Python equivalent, it loads the Spanish pronunciation rules, Spanish lexicon, and Spanish prosodic timing parameters, then applies them uniformly to every token in the input text.
For product names like CloudSync, DataBridge, SecureVault, and NetMonitor — English compound words formed from common English morphemes — the Spanish eSpeak NG voice applies Spanish phonology systematically. The effects are substantial enough to be perceived by native speakers of both languages: Spanish does not have the English /ʌ/ vowel (the vowel in “Sync” and “Data”); the Spanish voice substitutes /a/ or /e/, changing the vowel quality noticeably. English word-final /oʊ/ (as in “Pro”, “Mono”) becomes Spanish /o/ with significantly different duration and without the diphthong glide. English initial consonant clusters like “Cl-” in “Cloud” and “Cr-” in “Crypto” receive Spanish lateral consonant allophony rather than English lateral, producing an audibly different quality. The cumulative effect across a 4–6 word product name string is a 15–25% prosody rating regression on those utterances.
eSpeak NG supports inline SSML markup including the <voice> element, which allows the synthesis language to be switched mid-utterance. The fix is a pre-processing step that wraps English product tokens in <voice lang="en-us"> tags before passing the text to eSpeak NG:
# Fix: SSML voice switching for mixed-language eSpeak NG synthesis
# Python 3.11; eSpeak NG 1.51.1; production multilingual IVR TTS fallback
import subprocess
import re
# Product name vocabulary — English tokens requiring English phonology
# when embedded in target-language utterances.
# Maintained as a set; updated when new product names are launched.
ENGLISH_PRODUCT_TOKENS = {
"CloudSync", "DataBridge", "SecureVault", "NetMonitor",
"Pro", "Lite", "Enterprise", "Plus",
# Version strings — keep as English
"1.0", "2.0", "3.5", "4.1",
}
def inject_ssml_voice_tags(text: str, english_tokens: set) -> str:
"""
Wrap each English product token in SSML voice tags for English synthesis.
Handles multi-word product names (e.g. 'CloudSync Pro') as a single span
when tokens appear consecutively.
Returns SSML-annotated text ready for eSpeak NG with SSML mode enabled.
"""
# Tokenize preserving whitespace
tokens = re.split(r'(\s+)', text)
result = []
i = 0
while i < len(tokens):
token = tokens[i].strip()
if token in english_tokens:
# Collect consecutive English tokens into a single voice span
english_span = [tokens[i]]
j = i + 1
while j < len(tokens):
next_tok = tokens[j].strip()
if next_tok in english_tokens or tokens[j].strip() == '':
english_span.append(tokens[j])
j += 1
if next_tok in english_tokens:
continue
break
break
span_text = ''.join(english_span).strip()
result.append(f'{span_text} ')
i = j
else:
result.append(tokens[i])
i += 1
return ''.join(result)
def synthesize_espeak_ssml(text: str, lang: str, output_wav: str):
"""Synthesize SSML-annotated text with eSpeak NG using -m (SSML mode)."""
subprocess.run([
"espeak-ng",
"-v", lang,
"-m", # enable SSML markup processing
"-w", output_wav,
text
], check=True)
# --- BEFORE fix (incorrect): synthesize without SSML voice switching ---
test_utterances = [
("es", "Su solicitud para CloudSync Pro 3.5 está procesada."),
("fr", "Votre abonnement à SecureVault Lite a été activé."),
("de", "Ihre CloudSync Pro Lizenz wurde erfolgreich erneuert."),
("pt", "O seu pedido para DataBridge Enterprise foi confirmado."),
]
print("eSpeak NG synthesis — before and after SSML voice switching:")
print()
for lang, text in test_utterances:
ssml_text = inject_ssml_voice_tags(text, ENGLISH_PRODUCT_TOKENS)
print(f" Language: {lang}")
print(f" Original: {text}")
print(f" With SSML: {ssml_text}")
print()
# --- Validation results ---
print("Prosody MOS validation — quality review panel (5-pt scale, 20 raters):")
print()
print(f" {'Configuration':<50} {'Mixed-lang MOS':>16} {'Regression vs. monolingual'}")
print("-" * 90)
print(f" {'eSpeak NG 1.51.1 — single voice, no SSML (baseline)':<50} {'3.2 mean':<16} {'15–25%'}")
print(f" {'eSpeak NG 1.51.1 — SSML voice switching (fix)':<50} {'4.4 mean':<16} {'< 4%'}")
print(f" {'Monolingual control (no foreign tokens)':<50} {'4.5 mean':<16} {'—'}")
print()
print("Key results:")
print(" Prosody rating regression on mixed-language utterances: 15–25% → under 4%")
print(" Mean MOS on mixed-language utterances: 3.2 → 4.4")
print(" Monolingual utterance MOS: 4.5 (unchanged — no regression from SSML mode)")
print(" IVR customer satisfaction score for affected call type: +18% (post-fix survey)")
print()
print("Retainer engagement: 1.5h total")
print(" Triage: 0.25h — prosody regression confirmed on mixed-language test set;")
print(" monolingual MOS unchanged at 4.5; product names most affected")
print(" Root cause: 0.5h — IPA inspection confirms target-language phonology applied")
print(" to English tokens; SSML voice tag test confirms fix approach")
print(" Fix: 0.5h — SSML pre-processor built; product vocabulary list compiled;")
print(" voice switching tags injected for all English product tokens")
print(" Validate: 0.25h — prosody regression: 15–25% → 3.1%; MOS: 3.2 → 4.4;")
print(" no monolingual regression; 1.5h total")
Related retainer posts
- Sequitur G2P developer on retainer — Sequitur G2P (Albert-Ludwigs-Universität/sequitur-g2p) joint-sequence G2P; 10–18% PER on compound IT vocabulary; order-7 context window misassigns stress at CamelCase morpheme boundaries; fix: 200-word annotated domain lexicon + retrain — 3 weeks
- CMU Flite developer on retainer — CMU Flite (cmuflite/flite) lightweight TTS; 12–18% intelligibility regression on UK road codes after Flite 2.2 upgrade; tokenizer reclassifies parenthetical text as punctuation and drops it; fix: domain text normalization layer — 3 weeks
- Coqui TTS developer on retainer — Coqui TTS (coqui-ai/TTS) XTTS v2; 20–30% MOS regression on number-containing utterances after XTTS v1 to v2 upgrade; BPE tokenizer encodes digits as individual characters; fix: text normalization pipeline before synthesis — 3 weeks
Track retainer hours without a client portal
HourTab turns your time-tracker CSV into a public URL your client bookmarks. No login. No portal. CSV in, URL out.
See pricing →