Documentation
Google speech
Gemini TTS through OpenPaths for hosted playthroughs: cast voices per character, add delivery cues, and pay per new line.
The hosted player reads dialogue with Google Gemini TTS when the reader enables it in the game menu. Nothing is generated by opening a novel, saving voice settings, or building. Each new line charges the reader's credits; replaying a line reuses cached audio at no charge.
game/speech.json
Author the cast in the editor's Playthrough voices · Google panel, or write game/speech.json by hand. Build & run includes it in the manifest. Use the displayed character names, not Ren'Py variable ids.
Cues add bracketed performance directions without changing the visible dialogue: shouting, whispers, sad, happy, excited, angry, laughing, crying, tension, gentle, serious. Unknown characters get stable automatic voices; explicit casting guarantees distinct ones.
{
"default_voice": "Charon",
"language": "en-US",
"narration": false,
"characters": {"Mara": "Kore", "Ivo": "Puck"},
"cues": {"Get down!": "shouting", "They can hear us.": "whispers"}
}
Browser SDK
/static/js/vn/speech.js exports GOOGLE_VOICES, normalizeSpeech, speechText, speechRequest, loadSpeechSettings and installSpeech. The installed controller exposes enabled and update(request): pass the current dialogue request, or null when dialogue leaves the screen. Hosts must mute recorded voice playback while Google speech is enabled.
Advancing stops playback. An in-flight generation can still finish and be charged. The player keeps 24 clips; evicted clips may cost another call.
API and credits
POST /api/visualnovel/media/speech with input (1-1200 characters), voice and language. Same-origin requests carry the session cookie; API clients send Authorization: Bearer <secret>.
Responses carry audio_base64 or audio_url, format, credits_charged and cost_usd. Server cache hits add cached: true and charge zero credits. Cache identity covers account, host, model version, voice, language and the directed text; base64 audio persists privately within a 128 MiB budget per account and host. Failed generations are refunded and must be replayed.
curl -X POST https://netwrck.com/api/visualnovel/media/speech \
-H 'Authorization: Bearer <secret>' -H 'Content-Type: application/json' \
-d '{"input": "[whispers] They can hear us.", "voice": "Kore", "language": "en-US"}'
Netwrck