c# - 使用AudioRender设备作为AudioGraph UWP的输入

标签 c# audio uwp

我有一个功能齐全的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 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());

有关更多信息,请引用Audio graphs文档。

关于c# - 使用AudioRender设备作为AudioGraph UWP的输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53026841/

相关文章:

c# - 如何在用户本地时间设置 cookie 过期时间?

使用 FFTW 计算音频数据的离散傅立叶变换

c# - 使用 NAudio 播放自定义文件格式

uwp - 如何使用 fulltruSTLauncher 在 uwp 应用程序中启动 .exe 文件?

使用 Win32 API 拒绝 UWP 文件夹访问权限

c# - Unity C# 可滚动 GUI.BOX 不适用于 android

c# - Bootstrap 模态对话框不会出现在屏幕中央

c# - 在另一个线程上创建 WPF 进度窗口

javascript - Javascript检测点击但没有功能

msbuild - 在构建服务器上构建 UWP 应用程序/库