综述
Core Audio从Windows Vista开始。Core Audio有以下特性:
- Low-latency, glitch-resilient audio streaming.
- Improved reliability (many audio functions have moved from kernel mode to user mode).
- Improved security (processing of protected audio content takes place in a secure, lower-privilege process).
- Assignment of particular system-wide roles (console, multimedia, and communications) to individual audio devices.
- Software abstraction of the audio endpoint devices (for example, speakers, headphones, and microphones) that the user manipulates directly.
DirectSound,Direct Music,Windows multimedia waveXxx and mixerXxx,Media Foundation都是基于Core Audio
Core Audio的接口分以下几个模块:
Multimedia Device(MMDevice) API :音频设备枚举
Windows Audio Session API(WASAPI) :音频流创建与管理
DeviceTopology API :设备拓扑,音量控制,混音器
EndpointVolume API :独占流音频音量管理
详细内容
MMDevice API 头文件 Mmdeviceapi.h
WASAPI 头文件 Audioclient.h, Audiopolicy.h
DeviceTopology 头文件 Devicetopology.h
EndpointVolume API 头文件 Endpointvolume.h
WASAPI使用的头文件 Audiosessiontypes.h 位于%MSSdk%\include
目录下,%MSSdk%
是Windows SDK的根目录。
Core Audio设备枚举
Core Audio音频采集
CoreAudio音频采集有两种模式,分别是独占(AUDCLNT_SHAREMODE_EXCLUSIVE)与共享
(AUDCLNT_SHAREMODE_SHARED)
这两种模式有所区别:
参见页面:AUDCLNT_SHAREMODE Enumeration
User-Mode Audio Components
在共享方式下只能采集系统提供的格式的音频数据,在独占方式下可以自定义音频采集格式。
IAudioClient::GetDevicePeriod(__out_opt REFERENCE_TIME*phnsDefaultDevicePeriod,REFERENCE_TIME *phnsMinimumDevicePeriod)
可以通过GetDevicePeriod
获取音频的最小延迟,也就是最小的数据获取大小
Comments | NOTHING