Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Waveform Visualization in Ruby

I'm about to start a project that will record and edit audio files, and I'm looking for a good library (preferably Ruby, but will consider anything other than Java or .NET) for on-the-fly visualization of waveforms.

Does anybody know where I should start my search?

like image 490
btw Avatar asked Sep 03 '08 04:09

btw


2 Answers

That's a lot of data to be streaming into a browser. Flash or Flex charts is probably the only solution that will be memory efficient. Javascript charting tends to break-down for large data sets.

like image 59
hoyhoy Avatar answered Sep 29 '22 20:09

hoyhoy


When displaying an audio waveform, you will want to do some sort of data reduction on the original data, because there is usually more data available in an audio file than pixels on the screen. Most audio editors build a separate file (called a peak file or overview file) which stores a subset of the audio data (usually the peaks and valleys of a waveform) for use at different zoom levels. Then as you zoom in past a certain point you start referencing the raw audio data itself.

Here are some good articles on this:

Waveform Display

Build an Audio Waveform Display

As far as source code goes, I would recommend looking through the Audacity source code. Audacity's waveform display is pretty good and mostly likely does a similar sort of data reduction when rendering the waveforms.

like image 27
Nick Haddad Avatar answered Sep 29 '22 20:09

Nick Haddad