MCPcopy Create free account
hub / github.com/LabSound/LabSound / RtApiWasapi

Method RtApiWasapi

src/backends/RtAudio/RtAudio.cpp:4586–4603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4584//=============================================================================
4585
4586RtApiWasapi::RtApiWasapi()
4587 : coInitialized_(false)
4588 , deviceEnumerator_(NULL)
4589{
4590 // WASAPI can run either apartment or multi-threaded
4591 HRESULT hr = CoInitialize(NULL);
4592 if (!FAILED(hr))
4593 coInitialized_ = true;
4594
4595 // Instantiate device enumerator
4596 hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL,
4597 CLSCTX_ALL, __uuidof(IMMDeviceEnumerator),
4598 (void **) &deviceEnumerator_);
4599
4600 // If this runs on an old Windows, it will fail. Ignore and proceed.
4601 if (FAILED(hr))
4602 deviceEnumerator_ = NULL;
4603}
4604
4605//-----------------------------------------------------------------------------
4606

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected