winapi-rs
winapi-rs copied to clipboard
Update AudioClient
This PR rebases the #796 PR by @trmcnvn onto the latest 0.3 work.
Would be great to get this landed as we require AudioClient2 and AudioClient3 upstream for current work in cpal. Let me know if you need anything changed. Thanks.
@JoshuaBatty Would including...
const AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM: DWORD = 0x80000000;
const AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY: DWORD = 0x08000000;
const AUDCLNT_STREAMFLAGS_PREVENT_LOOPBACK_CAPTURE: DWORD = 0x01000000;
... in um/audiosessiontypes
be an option, while at it? The last one is Win10 rev 1803 upwards, but apparently that's a go. Plus, there's https://github.com/RustAudio/cpal/blob/fe22704d4adc2795f33f2e298c5450ece476d58c/src/host/wasapi/device.rs#L1224 to take care of.
I can raise a separate PR of course - sorry if this feels like a hijack.
@alcore thanks for that. I've added in the missing streamflags you mentioned. I think it would be nice to now land this PR as it is and then you can open up a separate PR for the KSAUDIO speaker layouts.
@retep998 just wondering if there is anything else you would like me to address or is this PR happy to be merged? Thanks.
PR needs to be updated to run on new CI.
Is this PR still being worked on? If not I may be able to take over.
I've tried copying code that I think is relevant to AudioClient3
and was able to create one with ActivateAudioInterfaceAsync
, but when I tried to use it's functions (ie. InitializeSharedAudioStream
) I get a E_NOIMPL
error (value 0x80004001). I'm guessing it has something to do with the crate winapi-x86_64-pc-windows-gnu
. It's also possible I'm doing something wrong.