Can WASAPI Renderer play mono audio on both channels?

Jim Fiocca 1 Reputation point
2022-09-11T15:01:28.657+00:00

I am upgrading a synthesizer application (using Visual C++ command line tools) from Wave to WASAPI for the lower latency. I'm trying to use the same WAVEFORMATEX settings but WASAPI appears to be more particular. It's basically 16-bit samples @44.1 kHz mono. I can't get shared mode to accept this setting at all. I got exclusive mode to work, but it only comes out one side. Wave played dual-mono automatically. Can I achieve this with WASAPI?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,223 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,179 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jeanine Zhang-MSFT 7,036 Reputation points Microsoft Vendor
    2022-09-12T07:26:17.453+00:00

    @Jim Fiocca

    The client calls the methods in the IAudioRenderClient interface to write rendering data to an endpoint buffer. For a shared-mode stream, the client shares the endpoint buffer with the audio engine. For an exclusive-mode stream, the client shares the endpoint buffer with the audio device.

    As far as I'm concerned WASAPI Renderer can play mono audio on both channels.

    I suggest you could try to use IAudioClient::IsFormatSupported method indicates whether the audio endpoint device supports a particular stream format.