Reenable WasApi loopback
This commit is contained in:
parent
3d2fddc13e
commit
78e8452150
1 changed files with 9 additions and 3 deletions
|
|
@ -33,8 +33,7 @@ use super::winapi::um::audioclient::{
|
||||||
self, IAudioClient, IID_IAudioClient, AUDCLNT_E_DEVICE_INVALIDATED,
|
self, IAudioClient, IID_IAudioClient, AUDCLNT_E_DEVICE_INVALIDATED,
|
||||||
};
|
};
|
||||||
use super::winapi::um::audiosessiontypes::{
|
use super::winapi::um::audiosessiontypes::{
|
||||||
AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
|
AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_EVENTCALLBACK, AUDCLNT_STREAMFLAGS_LOOPBACK};
|
||||||
};
|
|
||||||
use super::winapi::um::combaseapi::{
|
use super::winapi::um::combaseapi::{
|
||||||
CoCreateInstance, CoTaskMemFree, PropVariantClear, CLSCTX_ALL,
|
CoCreateInstance, CoTaskMemFree, PropVariantClear, CLSCTX_ALL,
|
||||||
};
|
};
|
||||||
|
|
@ -657,6 +656,13 @@ impl Device {
|
||||||
BufferSize::Default => (),
|
BufferSize::Default => (),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let mut stream_flags: DWORD = AUDCLNT_STREAMFLAGS_EVENTCALLBACK;
|
||||||
|
|
||||||
|
if self.data_flow() == eRender {
|
||||||
|
stream_flags |= AUDCLNT_STREAMFLAGS_LOOPBACK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Computing the format and initializing the device.
|
||||||
// Computing the format and initializing the device.
|
// Computing the format and initializing the device.
|
||||||
let waveformatex = {
|
let waveformatex = {
|
||||||
let format_attempt = config_to_waveformatextensible(config, sample_format)
|
let format_attempt = config_to_waveformatextensible(config, sample_format)
|
||||||
|
|
@ -673,7 +679,7 @@ impl Device {
|
||||||
// finally initializing the audio client
|
// finally initializing the audio client
|
||||||
let hresult = (*audio_client).Initialize(
|
let hresult = (*audio_client).Initialize(
|
||||||
share_mode,
|
share_mode,
|
||||||
AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
|
stream_flags,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
&format_attempt.Format,
|
&format_attempt.Format,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue