hle: speak accessibility narration through the host's WinRT synthesizer #691

Closed
arthercz wants to merge 2 commits from upstream-pr/691 into main
arthercz commented 2026-11-24 06:56:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by arthercz on 2026-11-24T06:56:56Z.


Speech streams were valid empty WAVE files, so the title's narration (accessibility menus and the like) was silent. This routes text (0x68) and SSML (0xa8) through Windows.Media.SpeechSynthesis and hands the title the spoken RIFF stream. When the host has no voice (no voices installed, WinRT unavailable), the empty-WAVE fallback stays, so the title still plays the stream and goes on.

  • streams become boxed handles, reclaimed by close (0x70); the synthesizer handle stays a fixed address
  • enumerate_voices stays a no-op: no title of ours asks, and the host's default voice speaks
  • the windows crate moves out of the diagnostics-only feature so its WinRT bindings link in release builds too
  • the unit test now speaks "Hello" and validates the returned WAVE by walking RIFF chunks (PCM, 16 kHz mono 16-bit, non-empty data) instead of asserting fixed offsets the host's stream does not guarantee

Verified on Windows 11: cargo test --workspace 264 passed; cargo clippy --workspace --all-features clean.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6576417625 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/691). Originally posted by [arthercz](https://github.com/arthercz) on 2026-11-24T06:56:56Z. --- Speech streams were valid empty WAVE files, so the title's narration (accessibility menus and the like) was silent. This routes text (0x68) and SSML (0xa8) through `Windows.Media.SpeechSynthesis` and hands the title the spoken RIFF stream. When the host has no voice (no voices installed, WinRT unavailable), the empty-WAVE fallback stays, so the title still plays the stream and goes on. - streams become boxed handles, reclaimed by close (0x70); the synthesizer handle stays a fixed address - `enumerate_voices` stays a no-op: no title of ours asks, and the host's default voice speaks - the `windows` crate moves out of the diagnostics-only feature so its WinRT bindings link in release builds too - the unit test now speaks "Hello" and validates the returned WAVE by walking RIFF chunks (PCM, 16 kHz mono 16-bit, non-empty data) instead of asserting fixed offsets the host's stream does not guarantee Verified on Windows 11: `cargo test --workspace` 264 passed; `cargo clippy --workspace --all-features` clean.
catminou4 commented 2026-11-24 07:01:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T06:58:45Z.

Review: COMMENTED


Static note only — this is a large PR (+1721, 30 files, Cargo.toml/Cargo.lock changes) routing accessibility speech through WinRT Windows.Media.SpeechSynthesis, which I can't build or run on macOS.

From the file list, the risky surfaces for a Windows verification pass:

  1. Cargo.lock/dependency additions — new crates in the speech path; worth confirming they're all permissively licensed and Windows-only-gated so macOS/Linux builds don't pull them.
  2. victory-formats xma/texture changes (shared with #692's fmt) — these crates DO build and test on macOS; if the speech work touched format parsing, that part is verifiable here and I'd want to see it.
  3. Empty-WAVE speech streams being the bug — the fix direction (real synthesis vs. silence) matches the symptom; the SSML (0xa8) path is the one titles actually use for narration, so prioritize testing that over plain text (0x68).

No objections from the static read, but this one really needs the Windows runtime pass before merge.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034960391 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/691#pullrequestreview-6034960391). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T06:58:45Z. **Review:** COMMENTED --- Static note only — this is a large PR (+1721, 30 files, Cargo.toml/Cargo.lock changes) routing accessibility speech through WinRT `Windows.Media.SpeechSynthesis`, which I can't build or run on macOS. From the file list, the risky surfaces for a Windows verification pass: 1. **Cargo.lock/dependency additions** — new crates in the speech path; worth confirming they're all permissively licensed and Windows-only-gated so macOS/Linux builds don't pull them. 2. **victory-formats xma/texture changes** (shared with #692's fmt) — these crates DO build and test on macOS; if the speech work touched format parsing, that part is verifiable here and I'd want to see it. 3. **Empty-WAVE speech streams** being the bug — the fix direction (real synthesis vs. silence) matches the symptom; the SSML (0xa8) path is the one titles actually use for narration, so prioritize testing that over plain text (0x68). No objections from the static read, but this one really needs the Windows runtime pass before merge.
LAKSHYA-cmd-tech commented 2026-11-24 08:02:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T07:15:03Z.

Review: APPROVED


Windows 11 MSVC runtime verification (rustc 1.98.1):

Addressing @catminou4's checklist:

  1. Dependencies: windows-future 0.3.2 and WinRT features added to windows 0.62.2 compile cleanly with permissive MIT/Apache-2.0 licensing.
  2. Formats: ictory-formats tests continue to pass 23/23 without regressions.
  3. Speech synthesis verification: Tested on Windows 11 host with est modules::speech::tests::streams_are_wave_files. Text (0x68) and SSML (0xa8) properly invoke WinRT Windows.Media.SpeechSynthesis, synthesize audio, and return valid RIFF WAVE PCM 16kHz mono headers and non-empty audio payloads. If WinRT speech is unavailable or no voices exist, the safe empty-WAVE fallback operates without crash.
  • cargo test -p victory-hle: 86 passed, 0 failed
  • cargo clippy -p victory-hle --all-targets -- -D warnings: clean (0 warnings)
  • cargo xtask policy: 151 files ok
<!-- greyfinch-sync:Marvisak/VIctory:review:6035123393 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/691#pullrequestreview-6035123393). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T07:15:03Z. **Review:** APPROVED --- Windows 11 MSVC runtime verification (rustc 1.98.1): Addressing @catminou4's checklist: 1. **Dependencies**: windows-future 0.3.2 and WinRT features added to windows 0.62.2 compile cleanly with permissive MIT/Apache-2.0 licensing. 2. **Formats**: ictory-formats tests continue to pass 23/23 without regressions. 3. **Speech synthesis verification**: Tested on Windows 11 host with est modules::speech::tests::streams_are_wave_files. Text (0x68) and SSML (0xa8) properly invoke WinRT Windows.Media.SpeechSynthesis, synthesize audio, and return valid RIFF WAVE PCM 16kHz mono headers and non-empty audio payloads. If WinRT speech is unavailable or no voices exist, the safe empty-WAVE fallback operates without crash. - cargo test -p victory-hle: 86 passed, 0 failed - cargo clippy -p victory-hle --all-targets -- -D warnings: clean (0 warnings) - cargo xtask policy: 151 files ok
upstream-sync closed this pull request 2026-11-25 01:04:48 +00:00
Marvisak commented 2026-11-25 01:07:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:27:25Z.


Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #82. The WinRT narration of #82 stacked on a workspace-wide cargo fmt (36 files); #82 is the focused version of the same feature.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148528860 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/691#issuecomment-7148528860). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:27:25Z. --- Automated triage for the maintainers. Closing because another open pull request covers the same change. See #82. The WinRT narration of #82 stacked on a workspace-wide cargo fmt (36 files); #82 is the focused version of the same feature. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!691
No description provided.