简体   繁体   English

如何选择声音设备播放声音?

[英]How to select sound device to play sounds?

I have a webbrowser in my form, I want to choose where I want to listen the sounds. 我的表单中有一个网络浏览器,我想选择我想听声音的地方。 I have 2 playback devices, Speakers and Headphones. 我有2个播放设备,扬声器和耳机。

I want to make a combobox to select the output of the sounds of my form/app. 我想制作一个组合框以选择表单/应用程序的声音输出。

I was reading about NAudio and DirectSound, but I cant find something usefull. 我正在阅读有关NAudio和DirectSound的信息,但找不到有用的东西。

I don't want to play a sound, I want to select the output of all the sounds of my controls. 我不想播放声音,我想选择控件所有声音的输出。

Anyone knows something about this for .Net (c#)? 有人知道有关.Net(c#)的信息吗?

Check CoreAudioAPI 检查CoreAudioAPI

You can enumerate the available list of audio devices using 您可以使用以下方法枚举音频设备的可用列表

MMDeviceEnumerator devEnum = new MMDeviceEnumerator();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM