是否可以获取指向 Windows 7 中默认音频端点设备缓冲区的指针?
此处使用 Win32 API。我一直在 MSDN 文档中搜索 Windows Vista+ 中的核心音频服务,但没有找到保护默认音频缓冲区的方法。
我的目标是建立正在播放的音频的实时频谱图数据。有什么方法可以在通过扬声器播放音频流之前访问它吗?
编辑:我想我找到了答案。发布在下面。
Working with the Win32 API here. I've been scouring through the MSDN documentation for the core audio services in Windows Vista+, and haven't had much luck finding a way to secure the default audio buffer.
My goal is to set up a real-time spectrograph data of the audio being played. Is there any way to access the audio stream before it is played through the speakers?
EDIT: I think I found the answer. Posted below.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
小伙子们好消息!我想出了一个解决办法。
WASAPI 环回录制模式,概述如下:http://msdn.microsoft.com/en-us/library/windows/desktop/dd316551(v=vs.85).aspx,列出详细介绍了一种“将音频引擎的输出流复制到应用程序的捕获缓冲区”的方法。它尽可能接近音频输出缓冲区的指针。
因此,从技术上讲,不可能实际访问音频引擎的缓冲区(至少在软件中),但您可以读取 Wave Out 混音是什么。
一旦我开始工作,我将发布有关任何延迟问题的信息。
Good News lads! I figured out a solution.
The WASAPI Loopback Recording mode, outlined here: http://msdn.microsoft.com/en-us/library/windows/desktop/dd316551(v=vs.85).aspx, lists in detail a way to "copy the output stream from the audio engine into an application's capture buffer". Its as close to a pointer of the audio output buffer as possible.
Therefore, technically it isn't possible to actually access the audio engine's buffer (in software at least), but you can read what's the Wave Out mix is.
Once I get this working, I'll post about any latency issues.