核心音频并从音频设备检索数据源
我已成功使用 AudioObjectPropertyAddress
和 AudioObjectGetPropertyData()
从音频设备获取数据源列表。
是否可以不用做一组就能得到数据源的体积? 我可以获得数据源的音量的唯一方法是:
- 设置我感兴趣的数据源 ID,因为设备的当前数据源
- 获取设备的音量。
这非常烦人,因为我必须先监听数据源集的回调才能完成,然后才能查询卷,这很麻烦,因为我想查询此数据源上的一些数据源设备。
提前致谢!
I've managed to get a list of data sources from an audio device by using AudioObjectPropertyAddress
and AudioObjectGetPropertyData()
.
Is it possible to get the volume of a data source without having to do a set?
The only way I can get the volume of a data source would be:
- set the data source id that I'm interested in as the devices's current data source
- get the volume of the device.
This is quite annoying as I would have to listen for a call back for the set of data source to be complete before I can query for the volume, and this is trouble some as I would like to query a few data sources that are on this device.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您需要使用低级别 AudioToolbox.framework 来完成这个。这个Stackoverflow问题有一些示例代码,可让您获取设备ID并获取特定的音量设备并且它不使用回调。
I would think that you need to use the you need to use the low level AudioToolbox.framework to accomplish this. This Stackoverflow question has some sample code that lets you take the deviceID and get the volume for the specific device and it does not use callbacks.