Javascript 音频通道活动
是否可以在 Javascript 下获取有关通道活动的一些值?我希望画出与音乐同步移动的经典 4 个电源棒。
注意:我不想以任何方式记录或更改正在播放的声音文件,只是获取一些活动值,我可以使用这些值根据音乐上下弹跳 CSS 条。
目标是 webkit(Android 上的 Safari + Chrome,如果可能的话,固定和移动均可)。
Is it possible to get some values regarding channel activity under Javascript? Im looking to draw the classical 4 power-bars that move in sync with the music.
Note: I am not looking to record or alter the soundfile being played in any way, just get some activity values that i can use to bounce CSS bars up and down in tune with the music.
Target is webkit (Safari + Chrome on android, both stationary and mobile if possible).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您似乎正在寻找的是 HTML5 音频数据 API。好消息是它存在,而且看起来实现起来相当简单,坏消息是它目前的兼容性非常非常小(看起来像现在最新版本的 Firefox)。
https://wiki.mozilla.org/Audio_Data_API
您也许可以使用 SoundManager2 的peakData,但这依赖于 Flash,并非所有 Android 设备都支持 Flash。
http://www.schillmania.com/projects/soundmanager2/doc/
What you seem to be looking for is the HTML5 Audio Data API. The good news is that it exists, and it looks fairly simple to implement, the bad news is that it has very, very little compatibility at the moment (looks like the latest versions of Firefox right now).
https://wiki.mozilla.org/Audio_Data_API
You might be able to get away with using SoundManager2's peakData, but this relies on Flash, which isn't available on all Android devices.
http://www.schillmania.com/projects/soundmanager2/doc/