Continuous WASAPI Ring-Buffer Sampling – Stackify

Your sample uses waveout API. You can check MSDN for WASAPI reference and usage.
Here is the basic description of WASAPI usage:
The client calls the methods in the IAudioRenderClient interface to write rendering data to an endpoint buffer.To request an endpoint buffer of a particular size, the client calls the IAudioClient::Initialize method. To get the size of the allocated buffer, which might be different from the requested size, the client calls the IAudioClient::GetBufferSize method.
To move a stream of rendering data through the endpoint buffer, the client alternately calls the IAudioRenderClient::GetBuffer method and the IAudioRenderClient::ReleaseBuffer method. The client accesses the data in the endpoint buffer as a series of data packets. The GetBuffer call retrieves the next packet so that the client can fill it with rendering data. After writing the data to the packet, the client calls ReleaseBuffer to add the completed packet to the rendering queue.
There is also this Microsoft C++ WASAPI example.

Read more here: Source link