[UWP]在C#UWP中更改音频通信 [英] [UWP]Change Audio communication in C# UWP

查看:116
本文介绍了[UWP]在C#UWP中更改音频通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改音频通信。我们正在开发VoIP应用程序。实施过程是 

How to change Audio communication. We are developing VoIP App. The implementation process is 

var audioSelector = MediaDevice.GetAudioRenderSelector();
$
var outputDevices = DeviceInformation.FindAllAsync(audioSelector);

var audioSelector = MediaDevice.GetAudioRenderSelector();
var outputDevices = DeviceInformation.FindAllAsync(audioSelector);

foreach(outputDevices中的var outDevice)

{

                 System.Diagnostics.Debug.WriteLine($" {outDevice.Id}:{outDevice.Name}:{outDevice.IsDefault} {outDevice.IsEnabled}");

foreach (var outDevice in outputDevices)
{
                System.Diagnostics.Debug.WriteLine($"{outDevice.Id} : {outDevice.Name} : {outDevice.IsDefault} {outDevice.IsEnabled}");

}

当我们选择蓝牙设备时,应用程序音频将通过蓝牙进行更改,听到或通话。

When we selected Bluetooth device then application audio is going to change and hearing or talk through Bluetooth.

请给我更改音频设备的过程

Please give me the process to change Audio device

推荐答案


Windows.Media.Audio
命名空间为音频路由,混合和处理方案创建音频图形。   音频
格拉夫
是一组通过其的音频数据流相互连接的音频节点。即使连接了耳机和其他设备,您也可以更改输入/输出设备,包括蓝牙设备。你可以参考

AudioCreation
样品,该方法的 CreateAudioGraph 在场景2中显示了如何将图表中的
路由到音频输出设备,音频文件或自定义代码。

There are some APIs in the Windows.Media.Audio namespace to create audio graph for audio routing, mixing, and processing scenarios.  Audio Graph is a set of interconnected audio nodes through which audio data flows. You can change input/output device even if headset and other device is connected, includes Bluetooth devices. You can refer to the AudioCreation sample, the method CreateAudioGraph in Scenario2 shows how to route out of the graph to audio output devices, audio files, or custom code.

最好的问候,

Roy


这篇关于[UWP]在C#UWP中更改音频通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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