c#中的MMDeviceEnumerator [英] MMDeviceEnumerator in c#

查看:663
本文介绍了c#中的MMDeviceEnumerator的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是MMDeviceEnumerator,它的重要性是什么?

在哪个名称空间我们可以找到它?

what is MMDeviceEnumerator,And what is importance of it?
In which name space we can find it?

推荐答案

什么是MMDevice: https://wiki.videolan.org/Documentation:Modules/mmdevice/ [ ^ ]



重要性: Vista Core Audio API Master Volume Control [ ^ ]



如何使用它: http://msdn.microsoft.com/en-us/library/windows/desktop/dd316556(v = vs.85).aspx [ ^ ]
what is MMDevice :https://wiki.videolan.org/Documentation:Modules/mmdevice/[^]

Importance of it : Vista Core Audio API Master Volume Control[^]

How to Use it :http://msdn.microsoft.com/en-us/library/windows/desktop/dd316556(v=vs.85).aspx[^]


问题是关于C#。

MMDeviceEnumerator的示例用法可以在 http://naudio.codeplex.com上的C#开源项目NAudio中找到。 / 使用最新来源 NAUDIO来源 [ ^ ]。

一旦你引用项目

The question was regarding C#.
An example usage of MMDeviceEnumerator can be found in the C# open source project NAudio at http://naudio.codeplex.com/ with the latest source at NAUDIO Source[^].
Once you reference the project with
#using NAudio.CoreAudioAPI



然后您可以使用以下内容枚举您的音频设备...


then you can enumerate your audio devices with the following...

var deviceEnum = new MMDeviceEnumerator();
var devices = deviceEnum.EnumerateAudioEndPoints(DataFlow.All, DeviceState.Active).ToList();



MMDeviceEnumerator定义如下:


The MMDeviceEnumerator is defined as follows:

/// <summary>
/// implements IMMDeviceEnumerator
/// </summary>
[ComImport, Guid("BCDE0395-E52F-467C-8E3D-C4579291692E")]
class MMDeviceEnumeratorComObject
{
}



如果你在注册表中查找GUID引用,它将在文件MMDevAPI.dll中实现


and if you look up the GUID reference in the registry, it is implemented in the file MMDevAPI.dll


如上所述,但CoreAudioAPI中的API不是全部在首都



使用NAudio.CoreAudioApi;
As above but the API in CoreAudioAPI is not all in capitals

using NAudio.CoreAudioApi;


这篇关于c#中的MMDeviceEnumerator的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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