Speech: the title's narration plays through the host's SAPI voice #1822
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1822
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1822"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@kais7654 on GitHub · 2026-11-24 23:01 UTC · original
kais7654:speech/sapi→main· +303 −33 · 3 files · 1 commits · openThe accessibility module handed back 44 bytes of silence for every stream, so narration was silent even on a machine with voices. A view of SAPI through the COM bindings this crate already carries renders the line the title sends (SSML as sent, plain text as a fallback) into an HGlobal-backed stream at the 16 kHz mono 16-bit format the console uses, and the WAV goes to the title through the same vtable as before. A machine with no voice, no SAPI, or a line the engine refuses, still gets the silence it got. Stream handles are registry slots encoded into odd pointer values, so no handle the title passes back is ever dereferenced as memory. Test-only, 4 tests.
Generated by Mistral Vibe.
@DesertGamer on GitHub · 2026-11-24 23:06 UTC · original
VIctory V2: community PRs, merged and tested
Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.
Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).
⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.
Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2
Unofficial community fork of Marvisak/VIctory, GPL-3.0.
@kais7654 on GitHub · 2026-11-24 23:16 UTC · original
@ruipedro-pinheiro Good questions — both are covered, here's where:
No SAPI voice installed: the fallback to silence is already the PR's behavior, not a crash path. synthesize() returns None on every failure: CoInitializeEx failing (other than RPC_E_CHANGED_MODE), CoCreateInstance failing (which is what happens on server editions or stripped Windows with no SAPI/voice), Speak failing, GlobalLock returning null — every error path returns early with None, no panic, no unwinding through COM. stream_audio maps that None to the same 44-byte silence WAV the module handed back before this change, and the title gets a valid stream either way (stream size/data still answer from the WAV bytes). So a machine with no voice behaves exactly as main does today.
16 kHz mono: it's the format the title already receives — the pre-existing SILENCE constant on main is a 16 kHz mono 16-bit WAV (RIFF fmt: PCM, 1 channel, 16,000 Hz), so the streams we hand back keep the format the playback side already parses. The title reads a complete WAV file through the same vtable methods as before; if it resamples or request another rate, that logic is unchanged and outside this diff. SAPI writes into the WAV we format because SetBaseStream pins the WAVEFORMATEX before Speak, so the bytes are always 16 kHz PCM regardless of the voice's native rate.
@Marvisak on GitHub · 2026-11-25 06:29 UTC · original
Automated triage for the maintainers.
Needs work.
crates/victory-hle/src/modules/speech.rsnow synthesizes the title's narration with the host's SAPI voice (sapi::synthesize, in-process COM, no network). It hands the WAVE bytes back throughstream_size/the copy slot, with silence as the fallback. The new Cargo lines are only feature flags ofwindows, which is already a dependency. The direction is sensible. One blocking issue:stream_handlepushes each synthesized WAVE into the globalSTREAMSvector, and nothing ever removes one:closeis still a no-op. A narrated menu creates a stream per spoken line, so a long session keeps growing, at about 32 KB per second of speech. Free the entry when the title closes or releases the stream. A handle that is an index into a vector that never shrinks would also need a free list, or a map keyed by a counter.Smaller:
stream_bytesclones the whole WAVE on every size query and every copy. Returning a length, or copying under the lock, avoids that.spokenstrips SSML tags to plain text, which is fine as a first step. Say so in the module docs, which still describe narration as silent.CI: no check runs on the head commit.
Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.