liarjs.dev
← Field notes
Locale

Speech voices: how a TTS list quietly leaks your real OS language

November 28, 2026 · 9 min read

Most spoofers pour their effort into canvas, WebGL and timezone, then leave one small surface completely untouched: the text-to-speech voice list. speechSynthesis.getVoices() returns the voices your operating system has installed. That set is a function of the OS and its installed languages, not of anything the browser lets you configure per tab. When the languages in that list disagree with the locale your persona claims, you have handed the detector a clean, cheap tell. The surface also carries a timing quirk that lets a naive self-test conclude everything is fine when it is not.

Voices matching the persona versus a host TTS list that leaks the real OS language

What getVoices() actually exposes

window.speechSynthesis.getVoices() returns an array of SpeechSynthesisVoice objects. Each one carries five readable fields:

Field Example (Windows en-US) What it encodes
name Microsoft David, English (United States) Human-readable voice name, often names the engine/OS
lang en-US BCP-47 language tag of the voice
default true for exactly one voice Which voice the platform uses when none is specified
localService true Whether the voice runs locally (SAPI) or via a remote service
voiceURI Microsoft David, English (United States) Platform voice identifier

Two properties of this list make it fingerprinting gold. First, it is OS-dependent: Windows ships the SAPI voices (Microsoft David, Microsoft Zira, sometimes Microsoft Mark on en-US), while macOS ships an entirely different roster (Alex, Samantha and friends). The names alone separate the platforms. Second, it is installed-language-dependent: the set of lang values reflects which language packs the host has. A Chinese Windows install exposes zh-CN voices, Microsoft Huihui, Microsoft Kangkang, because those ship with the Chinese language pack, whether or not the browser claims to be Chinese.

This is why the surface is read so widely. CreepJS enumerates it, Antoine Vastel’s demonstration sites read it and DataDome consumes it in production. MDN documents the list plainly as OS- and browser-dependent; nobody has to reverse-engineer anything to use it. It is a stock Web Speech API call.

voiceLangMismatch: the consistency tell

A detector does not care that you have voices. What it extracts is the disagreement between the voice list and the rest of your locale story. Call it voiceLangMismatch: if the default voice’s language or the set of voice lang values as a whole, disagrees with the Intl locale and navigator.language, that is a seam. In CreepJS it does not register as an outright lie; it contributes an orange LowerEntropy signal, the “this value drifts from the known-good cluster” class rather than the red judged-lie class. Orange still costs you. It marks the profile as deviating from a real population and it feeds the trust score.

The real failure mode is concrete and, in our competitor testing, common. A Chinese-Windows host exposes zh-CN voices, Huihui, Kangkang, while the persona claims en-US. So you have a US user whose text-to-speech engine speaks Mandarin. There is no benign story for that combination. A genuine US machine does not carry the Chinese SAPI voices unless someone deliberately installed the language pack, which stock US personas do not.

If that shape sounds familiar, it should. It is the same host-OS-leak family we documented for CJK fonts under offsetWidth enumeration and for the Microsoft YaHei UI platform-hints font name. The physical host is a Chinese Windows box; the persona is a US user; and every surface that reads actual OS state rather than a JavaScript getter leaks the truth. Fonts leak it through layout geometry, the UI-font hint through the platform-hints string, speech through the voice list. Same root cause, three independent surfaces and patching one does nothing for the other two.

The list gives away the OS too

The list betrays more than language. The voice names encode the operating system independently of the lang tags. A persona claiming Windows whose voice list contains Alex and Samantha has announced macOS, regardless of what language those voices speak. So the check has two axes:

  • Language axis, do the voice lang tags (especially the default voice’s) agree with Intl locale, navigator.language(s) and Accept-Language?
  • Platform axis, do the voice names/roster match the OS the persona claims? Windows means the Microsoft * SAPI family; macOS means the Apple roster.

A coherent US-Windows persona presents Microsoft David / Microsoft Zira / Microsoft Mark, all en-US, with exactly one carrying default: true. Anything else, Apple voice names on a Windows persona, zh-CN tags on an en-US persona or an empty list on a modern desktop Chrome that should have SAPI voices, is a deviation a matcher can key on.

The timing subtlety almost nobody accounts for

Here is the part that catches even careful teams. On Windows the SAPI voice list loads asynchronously. When a page first runs, getVoices() frequently returns an empty array, the voices simply are not populated yet. The platform fires a voiceschanged event on speechSynthesis once the list is ready and only after that does getVoices() return the real roster.

The consequence for probing is sharp. A short fingerprint probe, the 3-to-11-second scans typical of a quick automated pass, often calls getVoices(), sees [] and concludes there is nothing to check. It reports the speech surface as clean. A full CreepJS run, which takes on the order of 90 seconds and reaches its speech section well after page load, hits getVoices() after the voiceschanged event has fired, which is exactly when the real list surfaces, and with it the mismatch.

Short probes see zero voices because the SAPI list loads late; the leak only shows on a long run.

the engine-level recon notes

The practical trap: a spoofer runs a quick self-test, sees an empty voice list and marks speech as a non-issue. Then the profile hits a detector that waits for voiceschanged or simply takes long enough that the list has populated by the time it reads and the zh-CN voices appear. The self-test falsely passed because it never waited for the surface to load. Any honest probe of this dimension must register the voiceschanged handler and re-read, not trust the synchronous first call.

Reading the surface correctly

The correct pattern is to read getVoices() immediately (it may already be populated on macOS or on a warm Windows session) and also subscribe to voiceschanged so a late-loading list is not missed. Then extract the default voice’s lang and compare its base language against the locale.

// Resolve the voice list, accounting for the async Windows/SAPI load.
// getVoices() is often [] on first call; the real list arrives with
// the 'voiceschanged' event. Never trust the synchronous first read.
function getVoicesAsync(timeoutMs = 5000) {
  return new Promise((resolve) => {
    const synth = window.speechSynthesis;
    const immediate = synth.getVoices();
    if (immediate.length) return resolve(immediate);

    let done = false;
    const finish = () => {
      if (done) return;
      done = true;
      synth.removeEventListener('voiceschanged', onChange);
      resolve(synth.getVoices());
    };
    const onChange = () => finish();
    synth.addEventListener('voiceschanged', onChange);
    // Fallback: some engines never fire the event on a warm list.
    setTimeout(finish, timeoutMs);
  });
}

// voiceLangMismatch: does the DEFAULT voice's language agree with locale?
async function checkVoiceLocale() {
  const voices = await getVoicesAsync();
  if (!voices.length) return { status: 'empty', voices: 0 };

  const def = voices.find((v) => v.default) || voices[0];
  const voiceLang = (def.lang || '').toLowerCase();          // e.g. "zh-cn"
  const locale = (Intl.DateTimeFormat().resolvedOptions().locale
    || navigator.language || '').toLowerCase();               // e.g. "en-us"

  const voiceBase = voiceLang.split('-')[0];   // "zh"
  const localeBase = locale.split('-')[0];     // "en"

  return {
    status: voiceBase && localeBase && voiceBase !== localeBase
      ? 'mismatch' : 'ok',
    defaultVoice: def.name,
    voiceLang,
    locale,
    langs: [...new Set(voices.map((v) => v.lang))],
  };
}

Our own scanner runs the base-language comparison and weights a mismatch as a warn rather than a hard fail. In the same spirit as the timezone check, a bare disagreement is a signal rather than proof, and it earns its weight by stacking with the font and locale tells around it:

if (client.voices.defaultLang) {
  const loc = (client.intl.locale || navLang || '');
  const vfam = client.voices.defaultLang.split('-')[0].toLowerCase();
  const lfam = loc.split('-')[0].toLowerCase();
  if (vfam && lfam && vfam !== lfam)
    add('voice-locale', 'Speech voice vs locale', 'warn',
      `Default speech voice language "${client.voices.defaultLang}" ` +
      `doesn't match locale "${loc}" - may reveal the real host OS language.`, 8);
}

Fixing it: rebuild the list where the OS hands it over

Patching this cleanly is not a matter of intercepting getVoices() in page JavaScript, that reintroduces the native-function-integrity problem, where a lie-detector notices the function is no longer genuine [native code]. The right place is the engine level, at the exact point the OS hands the voice list to the browser. On Windows that is the voice-list callback (OnSetVoiceList in Chromium’s speech plumbing): rebuild the list per the persona’s language before it ever reaches the page.

For an en persona that means synthesizing the standard Windows en-US roster, Microsoft David, Microsoft Zira, Microsoft Mark, all tagged en-US, with exactly one default: true and dropping the host’s zh-CN voices entirely. Done at that layer, getVoices() remains genuine and the returned list is coherent with navigator.language(s), Accept-Language and Intl. The synchronous call and the post-voiceschanged call both return the same persona-appropriate roster, so a short probe and a 90-second run agree and neither leaks Mandarin.

One locale, one story

The larger discipline is that locale spans several independent surfaces rather than a single field, and every one must say the same thing:

Surface Signal Coherent value (US persona) Leaks if unpatched
navigator.language(s) array ["en-US", "en"] host language / missing base tag
Accept-Language HTTP header en-US,en;q=… primary tag ≠ languages[0]
Intl timezone resolvedOptions().timeZone America/Los_Angeles see timezone vs IP
Fonts offsetWidth enumeration US Windows set, no CJK SimSun / YaHei on the host
Platform-hints UI font system UI font name Segoe UI Microsoft YaHei UI
speechSynthesis voices default voice lang + roster en-US, Microsoft * zh-CN Huihui/Kangkang

The speech voice list is the quiet member of that group. It is easy to forget because it loads late and reads empty on the first call but that is precisely why it is worth getting right. A detector that waits sees what a spoofer’s quick self-test did not.

Takeaway

speechSynthesis.getVoices() leaks the real OS and its installed languages and it does so on a surface most spoofers never touch. The tell is voiceLangMismatch: a default voice speaking zh-CN under an en-US persona, the same host-OS leak that CJK fonts and the YaHei UI hint expose through other windows. The trap is timing. The Windows SAPI list loads asynchronously, so a short probe sees an empty array and wrongly clears the surface, while a full run reads it after voiceschanged and catches the mismatch. Read it correctly by waiting for the event; fix it at the engine level by rebuilding the roster per persona language where the OS hands it over. Then make sure it tells the same story as navigator.language, Accept-Language, Intl and your fonts, because a detector reads them together.

Sources & further reading
  1. CreepJS (Abraham Juliot)
  2. SpeechSynthesis.getVoices(), MDN
  3. niespodd/browser-fingerprinting
More field notes
← Back to field notes