Consider updating the WASAPI code to use a newer API which supports lower latency.
From noel@bandlab.com, it might be possible to use WASAPI's low-latency shared mode to reduce the latency. Something like:
/ Initialize the shared mode client for minimal delay.
HRESULT hr = client->Initialize(AUDCLNT_SHAREMODE_SHARED,
stream_flags,
0,
0,
reinterpret_cast<const WAVEFORMATEX*>(format),
session_guid);
if (FAILED(hr)) {
DVLOG(1) << "IAudioClient::Initialize: " << std::hex << hr;
return hr;
}
if (use_event) {
hr = client->SetEventHandle(event_handle);
if (FAILED(hr)) {
DVLOG(1) << "IAudioClient::SetEventHandle: " << std::hex << hr;
return hr;
}
}
UINT32 buffer_size_in_frames = 0;
hr = client->GetBufferSize(&buffer_size_in_frames);
if (FAILED(hr)) {
DVLOG(1) << "IAudioClient::GetBufferSize: " << std::hex << hr;
return hr;
}
Comment 1 by rtoy@chromium.org
, Aug 3Status: Duplicate (was: Available)