views:

1304

answers:

6

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?

+1  A: 

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.

hoyhoy
+1  A: 

Thanks. I was worried that might be the case. Can anyone recommend any tips for implementing this in Flex/Flash? I've never done anything nearly this complex with those tools.

Bryan Woods
+1  A: 

The other option is generating the waveforms on the server-side with GD or RMagick. But good luck getting RubyGD to compile.

hoyhoy
+1  A: 

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.

Nick Haddad
+1  A: 

i wrote one:

http://github.com/pangdudu/rude/tree/master/lib/waveform_narray_testing.rb

,nick

A: 

Processing is often used for visualization, and it has a Ruby port:

http://wiki.github.com/jashkenas/ruby-processing

endolith