我有一个功能齐全的AudioGraph系统,可以进行实时语音聊天。您可以在聊天之前和聊天期间选择AudioCapture和AudioRender设备,但是我也希望能够使用AudioRender设备中的音频在AudioCapture图上进行输入。我该怎么办?
我目前尝试仅使用设备ID选择设备,但它给出了错误:
"DeviceNotAvailable"
。
对于CreateAudioDeviceInputNodeResult result = await ingraph.CreateDeviceInputNodeAsync(MediaCategory.Media, nodesettings.EncodingProperties, selectedDevice);
selectedDevice正在selectedDevice = await DeviceInformation.CreateFromIdAsync(InputDeviceID);
最佳答案
源自官方文档remarks段,
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());
有关更多信息,请引用Audio graphs文档。
关于c# - 使用AudioRender设备作为AudioGraph UWP的输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53026841/