简体   繁体   中英

Javascript mp3 audio data

Say i have a HTML5 tag. Is there any possible way for Javascript on the page to get the current speaker output, and then graph it to produce a volume bar that got larger when the music got louder and smaller when the music got quieter? I don't care if it works in IE or not. If this is not possible, would it be possible to extract that data out of the mp3 file and hope it lines up? I REALLY don't want to use flash.

Edit: I was inspired by this . Unfortunately it uses hard-coded values which wont work for me.

Short answer, yes it's possible. Check out the esteemed Mr. Doob's example . Sadly, looks like the explanatory blog post is down.

Mozilla has a custom extension , but Doob's example is working in WebKit...

The JS Audio Data API will let you do this with an html5 audio tag, or audio that is played from javascript. See https://wiki.mozilla.org/Audio_Data_API for details and examples. I don't know offhand what the status of this API is in current browsers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM