f2dadec5
by Bohdan Tkachenko at 2026-05-26T12:19:43+02:00
sapi: Implement ISpVoice::GetStatus.
Populate SPVOICESTATUS from speech_voice state:
- ulCurrentStream tracks the stream currently being processed by
speak_proc (set at the start of the worker so it reflects the
in-flight stream, and sticks at the last processed value when idle,
per MSDN). Stored as last_stream_num on speech_voice.
- ulLastStreamQueued reuses the existing cur_stream_num counter, which
is incremented before each Speak queues a task.
- hrLastResult is the HRESULT of the most recently completed speak (set
at the end of speak_proc).
- dwRunningState is derived from async_wait_queue_empty(&queue, 0) so
it correctly reports SPRS_DONE both when idle and after a purge
clears queued tasks.
This unblocks Overwatch 2's Audio Captions accessibility TTS, which
tight-polls GetStatus for SPRS_DONE between Speak calls; the previous
E_NOTIMPL stub left the status struct untouched, leaving the game wedged
forever waiting for SPRS_DONE.
Add tests covering GetStatus with a NULL pointer and status fields before,
during and after sync and async Speak calls.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59749