Repository navigation
Pisco and Vodka Integration
Tonic serves as the standalone Apache-2.0 SAPI 5 speech layer for Pisco and Vodka, replacing GPL-3.0 espeak-ng and prebuilt onnxruntime binaries with a pure-Zig, zero-Python, patent-free speech engine.
In Pisco's Makefile.in, Tonic is tracked as a git submodule (tonic/, stable branch) and built directly via the tonic target (included in all-dist and default_pfx):
- Runs
zig build -Doptimize=ReleaseSafeinsidetonic/. - Copies all three cross-compiled Windows PE
sapi.dllbinaries into Pisco's distribution tree:files/lib/vodka/tonic/x86_64-windows/sapi.dllfiles/lib/vodka/tonic/i386-windows/sapi.dllfiles/lib/vodka/tonic/aarch64-windows/sapi.dll
- Copies the native Linux shared library and CLI tool:
files/lib/libtonic.sofiles/bin/tonic
- Records the Tonic submodule revision into
files/lib/vodka/tonic/version.
To rebuild only Tonic inside an existing Pisco build directory:
make tonicPisco wires Tonic automatically into every game prefix and launch environment:
During default_pfx generation, setupTonicSymlinks links Tonic's multi-architecture sapi.dll binaries directly into the prefix's Windows system directories:
-
drive_c/windows/system32/sapi.dll->files/lib/vodka/tonic/x86_64-windows/sapi.dll(oraarch64-windowson ARM64 builds) -
drive_c/windows/syswow64/sapi.dll->files/lib/vodka/tonic/i386-windows/sapi.dll
At game launch, the pisco launcher:
-
Prepends Tonic to
VODKADLLPATH:- Default graphics path:
files/lib/vodka/bitters:files/lib/vodka/tonic:files/lib/vodka - Fallback graphics path (
PROTON_USE_VODKAGFX=1):files/lib/vodka/tonic:files/lib/vodka
- Default graphics path:
-
Copies/links
sapi.dllinto the per-game prefix'ssystem32andsyswow64directories alongside tracked prefix files. -
Injects the native DLL override: Adds
sapi=ntoVODKADLLOVERRIDESautomatically unless the user explicitly specifies a customsapi=...override.
# Force Tonic's built-in formant synthesizer (skip host speech-dispatcher probe)
TONIC_NO_HOST_SPEECH=1 %command%
# Mute SAPI 5 waveOut playback while keeping SAPI COM calls functional
TONIC_NO_AUDIO_PLAYBACK=1 %command%
# Disable SAPI 5 WinMM microphone capture
TONIC_NO_MIC_CAPTURE=1 %command%
# Override sapi.dll resolution explicitly via Vodka DLL overrides
VODKADLLOVERRIDES="sapi=b" %command%When a Windows game or application running under Vodka creates a SAPI 5 COM object (CLSID_SpVoice, CLSID_SpInprocRecognizer, CLSID_SpSharedRecognizer, CLSID_SpObjectTokenCategory, or CLSID_SpObjectToken):
Windows Title (PE64 or CS=0x23 WoW64 PE32)
│ CoCreateInstance -> sapi.dll!DllGetClassObject
▼
Tonic sapi.dll (freestanding Windows PE, link_libc = false)
├── TTS Playback: winmm.dll (waveOutOpen/Write @ 22050 Hz mono)
├── ASR Capture: winmm.dll (waveInOpen/AddBuffer @ 16000 Hz mono)
├── Notifications: user32.dll (PostMessageW), kernel32.dll (CreateEventW)
└── COM Memory: ole32.dll (CoTaskMemAlloc / CoTaskMemFree)
│
▼
Vodka Runtime (libvodka_ntdll.so + Win32 DLLs + libvodka_audio.so)
└── PipeWire (primary) -> ALSA (fallback) -> Software Sink (headless)
- Because
sapi.dllresolveswinmm.dll,user32.dll, andole32.dlldynamically viaLoadLibraryAandGetProcAddress, it integrates cleanly with Vodka's PE64 and hardwareCS=0x23PE32/WoW64 loaders without static import dependency bloat. - Audio played through
ISpVoiceor captured throughISpRecognizerflows through Vodka'swinmm.dllandlibvodka_audio.sodirectly to PipeWire or ALSA on Linux.
To test a freshly built sapi.dll directly inside a standalone Vodka prefix:
# Build Tonic
zig build -Doptimize=ReleaseSafe
# Point Vodka's DLL search path at Tonic's output directory and enable native sapi.dll
VODKAPREFIX=~/.vodka \
VODKADLLPATH="/path/to/tonic/zig-out/lib/tonic:/path/to/vodka/zig-out/lib/vodka" \
VODKADLLOVERRIDES="sapi=n" \
/path/to/vodka/zig-out/bin/vodka your_sapi_app.exeYou can also place x86_64-windows/sapi.dll in $VODKAPREFIX/drive_c/windows/system32/sapi.dll and i386-windows/sapi.dll in $VODKAPREFIX/drive_c/windows/syswow64/sapi.dll for persistent per-prefix testing.
Copyright (c) 2026 buntatoes. Tonic is a 100% standalone speech engine built from scratch and licensed under the Apache License 2.0. The Tonic, Pisco, Vodka, and Bitters names, wordmarks, and logos are All Rights Reserved.
Trademarks & Non-Affiliation: Windows and SAPI are trademarks or registered trademarks of Microsoft Corporation. Steam, Steam Play, and Proton are trademarks or registered trademarks of Valve Corporation. Linux, AMD, NVIDIA, Intel, and other third-party trademarks belong to their respective owners; Tonic is an independent open-source project and is not affiliated with, endorsed by, or sponsored by any of them.
Design & Engine
Build & Usage
Support
Links
-
Tonic Repository (
unstable/stable) - Pisco · Pisco Wiki
- Vodka · Vodka Wiki
- Bitters
- Apache-2.0 License