Fix SAPI5 WASAPI audio #18658
Fixes #17967.
Summary of the issue:
When rate boost is enabled and the rate is fast enough, if some audio takes longer time to process, an audio gap might appear in the speech audio.
Description of user facing changes:
The audio gap issue should be fixed.
Description of developer facing changes:
None.
Description of development approach:
Wait for at least 50ms of audio data before sending the first chunk to the output device.
This mitigates the problem when the first small chunk is immediately played, but during processing of the next chunk, there isn't enough audio to cover this duration, leaving audible gaps.
Also the return value of IStream::Write is changed to S_OK instead of an error code during cancellation.