Speech: the title's narration plays through the host's SAPI voice #1820
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-24T23:01:56Z.
The 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.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:03:41Z.
Review: COMMENTED
Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff.
Title narration through the host's SAPI voice: 18K HLE speech module — Windows-only, needs a Windows session with audio to validate.
Imported from Marvisak/VIctory. Originally posted by Melow-code on 2026-11-24T23:08:34Z.
Review: COMMENTED
SAPI integration looks right for the happy path. Two questions:
Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-24T23:06:52Z.
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.
Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-24T23:16:06Z.
@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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:29:56Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.