使用AudioRender设备作为AudioGraph UWP的输入 [英] Using AudioRender device as Input for AudioGraph UWP

查看:99
本文介绍了使用AudioRender设备作为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);

推荐答案

源自官方文档

调用 FindAllAsync ,并传入 GetAudioCaptureSelector 返回的值,以获取表示可用捕获设备的DeviceInformation对象的列表.有关更多信息,请参阅音频图.

Call 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());

有关更多信息,请参考 音频图 文档.

For more please refer Audio graphs document.

这篇关于使用AudioRender设备作为AudioGraph UWP的输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆