如何处理声卡缓冲区

发布于 2024-09-18 04:06:24 字数 233 浏览 3 评论 0原文

我正在尝试做一个屏幕闪烁应用程序,根据音频闪烁屏幕(就像音频可视化工具,但不是像条形图或类似的东西那样的可视化,只是闪烁屏幕)。

我已经制作了音乐播放器,并且知道如何使小部件全屏显示并更改颜色(它将闪烁),但我不知道如何检测(我认为它是声卡)缓冲区已满,因为当它已满时我会改变小部件的颜色,这会非常快,所以屏幕闪烁得非常快。 关于如何检测缓冲区是否已满的任何想法,或者我可能采取的任何其他方法来实现我的目标?

预先感谢。

Im trying to do a screen-flashing application that flashes the screen depending on the audio(like an audio visualizer, but instead of a visualization like bars or something like that, just flash the screen).

I already made the music player and know how to make the widget get full screen and change color(which will flash), but I dont know how to detect the (I think it's audio-card)buffer is full, because when it is full I would change the color of the widget, and this would be really super fast, so the screen flashes super quickly.
Any ideas on how to detect if the buffer is full, or any other approach I might pursue to achieve my goal?

Thanks beforehand.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

策马西风 2024-09-25 04:06:24

您检查过 SoundMixer 类的computeSpectrum 方法吗?它不会为您提供缓冲区信息,而是返回有关正在播放的声音的信息,您可以使用这些信息以图形方式表示声音。

Have you checked the SoundMixer Class computeSpectrum method? It doesn't give you a buffer info rather it returns info about the sound being played that you can use in order to represent the sound graphically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文