【问题标题】:Using AudioRender device as Input for AudioGraph UWP使用 AudioRender 设备作为 AudioGraph UWP 的输入
【发布时间】:2018-10-27 22:32:20
【问题描述】:

我有一个功能齐全的 AudioGraph 系统,可用于实时语音聊天。您可以在聊天之前和聊天期间选择 AudioCapture 和 AudioRender 设备,但是我也希望能够使用来自 AudioRender 设备的音频在 AudioCapture 图表上进行输入。我该怎么办?

我目前尝试只选择具有设备 ID 的设备,但它给出了错误: "DeviceNotAvailable"

CreateAudioDeviceInputNodeResult result = await ingraph.CreateDeviceInputNodeAsync(MediaCategory.Media, nodesettings.EncodingProperties, selectedDevice);

被选中的设备

selectedDevice = await DeviceInformation.CreateFromIdAsync(InputDeviceID);

【问题讨论】:

    标签: c# audio uwp


    【解决方案1】:

    来源于官方文档remarks段,​​p>

    调用FindAllAsync,传入GetAudioCaptureSelector返回的值,获取代表可用捕获设备的DeviceInformation对象列表。有关详细信息,请参阅音频图表。

    Windows.Devices.Enumeration.DeviceInformationCollection devices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(Windows.Media.Devices.MediaDevice.GetAudioRenderSelector());
    

    更多信息请参考Audio graphs文档。

    【讨论】:

    • 这只是告诉你如何选择设备,它并没有告诉我们将渲染设备设置为输入节点的问题。我有着同样的问题。有效的DeviceInformation 实例,相同的错误消息。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-02-24
    • 1970-01-01
    • 2016-04-14
    • 1970-01-01
    • 1970-01-01
    • 2017-02-01
    • 1970-01-01
    相关资源
    最近更新 更多