benalavi/waveform — Issue #5: waveform broken for mono audio sources
Author: benalavi
Created: 2011-11-17 21:13:14+00:00
State: open

appears to explode when attempting to draw the waveform for a mono audio source

```
Sampling 43 frames per sample: /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/waveform-0.0.3/lib/waveform.rb:249:in `block in channel_peak': undefined method `[]' for 0.001220703125:Float (NoMethodError)
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/ruby-audio-1.5.0/lib/ruby-audio/buffer.rb:17:in `block in each'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/ruby-audio-1.5.0/lib/ruby-audio/buffer.rb:16:in `times'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/ruby-audio-1.5.0/lib/ruby-audio/buffer.rb:16:in `each'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/waveform-0.0.3/lib/waveform.rb:247:in `channel_peak'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/waveform-0.0.3/lib/waveform.rb:223:in `block in peak'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/waveform-0.0.3/lib/waveform.rb:222:in `each'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/waveform-0.0.3/lib/waveform.rb:222:in `peak'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/waveform-0.0.3/lib/waveform.rb:193:in `block (2 levels) in frames'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/waveform-0.0.3/lib/waveform.rb:320:in `timed'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/waveform-0.0.3/lib/waveform.rb:191:in `block in frames'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/waveform-0.0.3/lib/waveform.rb:186:in `open'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/waveform-0.0.3/lib/waveform.rb:186:in `frames'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/waveform-0.0.3/lib/waveform.rb:131:in `generate'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/gems/waveform-0.0.3/bin/waveform:56:in `'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/bin/waveform:19:in `load'
from /Users/cyberf/.rvm/gems/ruby-1.9.2-rc2/bin/waveform:19:in `

'
```

```
Sampling 135520 frames per sample: /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/waveform-0.0.3/lib/waveform.rb:249:in `block in channel_peak': undefined method `[]' for 0.0:Float (NoMethodError)
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/ruby-audio-1.5.0/lib/ruby-audio/buffer.rb:17:in `block in each'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/ruby-audio-1.5.0/lib/ruby-audio/buffer.rb:16:in `times'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/ruby-audio-1.5.0/lib/ruby-audio/buffer.rb:16:in `each'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/waveform-0.0.3/lib/waveform.rb:247:in `channel_peak'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/waveform-0.0.3/lib/waveform.rb:223:in `block in peak'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/waveform-0.0.3/lib/waveform.rb:222:in `each'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/waveform-0.0.3/lib/waveform.rb:222:in `peak'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/waveform-0.0.3/lib/waveform.rb:193:in `block (2 levels) in frames'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/waveform-0.0.3/lib/waveform.rb:320:in `timed'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/waveform-0.0.3/lib/waveform.rb:191:in `block in frames'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/waveform-0.0.3/lib/waveform.rb:186:in `open'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/waveform-0.0.3/lib/waveform.rb:186:in `frames'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/waveform-0.0.3/lib/waveform.rb:131:in `generate'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/gems/waveform-0.0.3/bin/waveform:56:in `'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/bin/waveform:19:in `load'
from /Users/hackeron/.rvm/gems/ruby-1.9.3-p0/bin/waveform:19:in `

'
```