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

Closed
github-bot wants to merge 2 commits from gh-pr/691/head into gh-pr/691/base
Owner

@⁠arthercz on GitHub · 2026-11-24 06:56 UTC · original
arthercz:speech-winrt → main · +1807 −650 · 36 files · 2 commits · closed without merging

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.

**@⁠arthercz** on GitHub · 2026-11-24 06:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/691) `arthercz:speech-winrt` → `main` · +1807 −650 · 36 files · 2 commits · closed without merging 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.
- cargo fmt: 168 formatting differences in 32 files
- xmem.rs: initialize PERFORMANCE_INFORMATION cb in the struct literal
  (clippy::field_reassign_with_default)
Speech streams were valid empty WAVE files, so the title's narration
(accessibility menus and the like) was silent. Route text (0x68) and
SSML (0xa8) through Windows.Media.SpeechSynthesis and hand the title the
spoken RIFF stream; when the host has no voice (no voices installed,
WinRT unavailable), keep the empty-WAVE fallback 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

Verified on Windows 11: the unit test now speaks "Hello" and validates
the returned WAVE (RIFF chunk walk, PCM 16 kHz mono 16-bit, non-empty
data); cargo test --workspace 264 passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:10 +00:00
github-bot closed this pull request 2026-11-26 04:13:10 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:27 UTC · original

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.

**@⁠Marvisak** on GitHub · 2026-11-25 00:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/691#issuecomment-7148528860) 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

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!691
No description provided.