How is SndVol able to change the volume level of a given audio session?(SndVol 如何能够改变给定音频会话的音量?)
问题描述
我正在编写自己的 API 来执行 SndVol 系统实用程序的一些功能.我希望这个 API 的一部分能够设置给定 ,但我遇到了一个问题,虽然我能够使用 IAudioSessionEnumerator,IAudioSessionEnumerator 只允许我访问 IAudioSessionControl 对象,但我需要IAudioClient 对象来获取 ISimpleAudioVolume 对象,我可以使用它来设置音频会话音量.是否可以获得与 IAudioSessionControl 对象关联的 IAudioClient 对象?
如果在 IAudioSessionControl 接口上调用 QueryInterface,通常可以访问 ISimpleAudioVolume.
I am writing my own API to perform some of the functionality of the SndVol system utility. I would like part of this API to be the ability to set the volume level of a given audio session.
SndVol displays a slider on the "Device" panel that the user can use to change the master volume level of the audio device as well as a slider for each audio session (on the "Applications" panel) that changes the volume level of the session:
If I drag the slider handle for one of the audio sessions, then SndVol is able to change the audio session's volume level. How does it do that?
I thought that it was possible using Windows Vista's Core Audio API, but I encountered the problem that although I am able to iterate audio sessions of a device using an IAudioSessionEnumerator, the IAudioSessionEnumerator only gives me access to IAudioSessionControl objects, but I need the IAudioClient object to obtain an ISimpleAudioVolume object that I can use to set the audio session volume level. Is it possible to get the IAudioClient object associated with an IAudioSessionControl object?
If you call QueryInterface on the IAudioSessionControl interface, you can often get access to an ISimpleAudioVolume.
这篇关于SndVol 如何能够改变给定音频会话的音量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SndVol 如何能够改变给定音频会话的音量?
基础教程推荐
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- CString 到 char* 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 初始化列表*参数*评估顺序 2021-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
