How can I get the amplitude data from an MP3 file?
Asked Answered
W

1

6

Im trying to use html5 and javascript to get the amplitude (and other components) of an mp3. Any libraries that would help?

Weksler answered 12/9, 2012 at 2:44 Comment(2)
I'd +1 for the nice question, but sadly, StackOverflow is not a search engine.Degrade
@JosephtheDreamer because StackOverflow.com is not a search engine, you get actually revelant answers, thus your point is moot :)Utrecht
U
7

First you need to divide the problem to real-time playback and non-linear amplitude, etc. access.

For real-time playback you can use Web Audio API

https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html

Example for beats

https://beatdetektor.svn.sourceforge.net/svnroot/beatdetektor/trunk/core/js/beatdetektor.js

For non-linear, non-real-time access, there are two ways

If you allow server-side processing you can write your proxy sending the data to Echo Nest servers and retrieve information via Echo Next Remix API

Extracting beats out of MP3 music with Python

If you want to avoid server-side processing at all you need to decode the MP3 in pure Javascript to get the access to the raw audio data in non-real-time fashion

https://github.com/devongovett/mp3.js

Then you need to apply the necessary filters on the raw audio data to extract the information you need on it. This is a problem of signal processing and not directly connected to Javascript programming. If you specify more carefully what kind of data you are after people might help you with related Javascript libraries, like ones for fast fourier transform.

Utrecht answered 15/9, 2012 at 11:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.