开发者

Javascript - Get Sound Data

开发者 https://www.devze.com 2023-04-06 17:01 出处:网络
I\'m wondering if any new HTML5 functions or existing JS library would allow me to access information about the sound that\'s currently playing in an Audio object. For example, I\'d like to be able to

I'm wondering if any new HTML5 functions or existing JS library would allow me to access information about the sound that's currently playing in an Audio object. For example, I'd like to be able to access an array of ranges the a song is currently playing at (that is, low values appear for deep bass sounds and higher values appear for shriller sounds). I'm not a sound engineer, so I'm not quite sure what the correct terminology is.

A comparable library would be the C++ BASS library (http://www.un4seen.com/), although I certainly don't need th开发者_StackOverflow中文版e same breadth of functionality.

I did a little more digging around and found this: chromium.googlecode.com/svn/trunk/samples/audio/visualizer-gl.html It's pretty much what I'm looking for, but I can't figure out how it works. Thoughts?


  • The chromium visualizer uses the Web Audio API.
  • Firefox offers the Audio Data API.

These are the two options available at the moment, and they're not compatible with each other. Eventually an agreement will be reached.

If you intend to do something cross-browser, you're condemned to using Flash for now, there is a pretty good library called SoundManager2 that gives you the necessary data. Check out their visualization demos.

0

精彩评论

暂无评论...
验证码 换一张
取 消