Files
MicroslopSam/README.md
T

2.9 KiB

MicroslopSam

Run SAPI4 text-to-speech voices on Linux.

Primary approach: a Winelib host — a native Linux ELF that uses Wine's libraries to load the original 32-bit SAPI4 runtime and TTS engine DLLs.

Voice targets:

  • Microsoft Sam / Mary / Mike — MSTTS engine (msttssyn.dll + .vce data)
  • AT&T Flextalk 2.1 — "Keith Bell" and "Kerry Watson" (FlexTalk.dll)

Long-term: replace Wine-provided pieces with own shims (rehost) for a pure-native build, and keep a path to a fully portable engine.

Status (working)

  • Winelib host builds and runs: build/sapi4host.exe (launcher) + build/sapi4host.exe.so (native 32-bit ELF).
  • Voices enumerate and synthesize:
    • MSTTS: Sam, Mary, Mike (+ telephone and effect variants)
    • AT&T Flextalk: Keith Bell, Kerry Watson
  • Test output: build/test_sam.wav (22.05 kHz), build/test_Keith_Bell.wav, build/test_Kerry_Watson.wav (11.025 kHz).

Build

Dependencies (once, as root):

sudo setup/install-deps.sh

Runtime + MSTTS voices (once):

setup/setup-prefix.sh

Flextalk voices (once; needs the extracted installer, see docs/NOTES.md):

setup/setup-flextalk.sh

Host:

# Winelib (native ELF + launcher)
winegcc -m32 -O2 -o build/sapi4host host/sapi4host.c -I../reference \
    -lole32 -luser32 -ladvapi32

# PE fallback (runs under wine):
i686-w64-mingw32-gcc -O2 -static -o build/sapi4host.exe host/sapi4host.c \
    -I../reference -lole32 -luser32 -ladvapi32 -luuid

Usage

setup/run.sh -l
setup/run.sh -v Sam -t "Hello." -o sam.wav
setup/run.sh -v "Keith Bell" -t "Hello." -o keith.wav -p 100 -s 150

Options: -v voice, -t text, -o output WAV, -p pitch, -s speed.

Layout

  • host/sapi4host.c — host: voice select, pitch/speed, text -> WAV
  • setup/install-deps.sh — Wine/Winelib/helpers (root)
  • setup/setup-prefix.sh — prefix + SAPI4 runtime + MSTTS engine/voices
  • setup/setup-flextalk.sh — Flextalk files + registry
  • setup/inf2reg.py — INF AddReg -> .reg converter
  • setup/run.sh — run helper (prefix + Xvfb)
  • docs/NOTES.md — registry/CLSID facts, runtime RE notes, gotchas

Known issues

  • xvfb-run is flaky on this host. setup/run.sh starts a persistent Xvfb (:77) instead; Wine needs a working X display because the runtime creates windows.
  • Flextalk's default pitch/speed report as maximum (250/390) through ITTSAttributes; values are still adjustable with -p/-s.
  • The Flextalk archive lacks data2.cab; unshield -O extracts data1.cab but one tail file (WatsonUNInstall.dll) is incomplete.

Reference material (not in this repo)

  • ../reference/speech.h — SAPI4 SDK header
  • ../reference/SAPI4-CLI, ../reference/TETYYS-SAPI4 — host examples
  • ../Microsoft-Sam-Mary-Mike-TruVoice-WSAPI4 — installers/payloads
  • ../flextalk — Flextalk installer archive + extraction
  • /mnt/ghidra/decomp/{msttssyn.dll,speech.dll}/ — decompiled corpora