使用AudioRender设备作为AudioGraph UWP的输入 [英] Using AudioRender device as Input for AudioGraph UWP
问题描述
我有一个功能齐全的AudioGraph系统,可以进行实时语音聊天.您可以在聊天之前和聊天期间选择AudioCapture和AudioRender设备,但是我也希望能够使用AudioRender设备中的音频在AudioCapture图上进行输入.我该怎么办?
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?
我目前仅尝试使用设备ID选择设备,但是它给出了错误:"DeviceNotAvailable"
.
I currently have tried just selecting the device with the device Id however it gives the error:
"DeviceNotAvailable"
.
对于
CreateAudioDeviceInputNodeResult结果=等待ingraph.CreateDeviceInputNodeAsync(MediaCategory.Media,nodesettings.EncodingProperties,selectedDevice);
selectedDevice are
selectedDevice being
selectedDevice =等待DeviceInformation.CreateFromIdAsync(InputDeviceID);
推荐答案
源自官方文档 调用 Call 有关更多信息,请参考 音频图 文档. For more please refer Audio graphs document. 这篇关于使用AudioRender设备作为AudioGraph UWP的输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! FindAllAsync
,并传入 GetAudioCaptureSelector
返回的值,以获取表示可用捕获设备的DeviceInformation对象的列表.有关更多信息,请参阅音频图.
FindAllAsync
, passing in the value returned by GetAudioCaptureSelector
, 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());