问题
I have a fully functional AudioGraph system in place for a realtime voice chat. You can select the AudioCapture and AudioRender devices before and during the chat however I'd also like to be able to use Audio from the AudioRender devices for input on the AudioCapture graphs. How can I go about that?
I currently have tried just selecting the device with the device Id however it gives the error:
"DeviceNotAvailable"
.
for
CreateAudioDeviceInputNodeResult result = await ingraph.CreateDeviceInputNodeAsync(MediaCategory.Media, nodesettings.EncodingProperties, selectedDevice);
selectedDevice being
selectedDevice = await DeviceInformation.CreateFromIdAsync(InputDeviceID);
回答1:
Derive from official document remarks segment,
Call
FindAllAsync
, passing in the value returned byGetAudioCaptureSelector
, to get the list of DeviceInformation objects representing the available capture devices. For more information, see Audio graphs.
Windows.Devices.Enumeration.DeviceInformationCollection devices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(Windows.Media.Devices.MediaDevice.GetAudioRenderSelector());
For more please refer Audio graphs document.
来源:https://stackoverflow.com/questions/53026841/using-audiorender-device-as-input-for-audiograph-uwp