Using AudioRender device as Input for AudioGraph UWP

烈酒焚心 提交于 2021-01-28 20:24:31

问题


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?

I currently have tried just selecting the device with the device Id however it gives the error: "DeviceNotAvailable".

for

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

selectedDevice being

selectedDevice = await DeviceInformation.CreateFromIdAsync(InputDeviceID);


回答1:


Derive from official document remarks segment,

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.



来源:https://stackoverflow.com/questions/53026841/using-audiorender-device-as-input-for-audiograph-uwp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!