Skip to content

Commit

Permalink
add getPeaks background compatibility (#1072)
Browse files Browse the repository at this point in the history
* add getPeaks background compatibility

* remove space

* add space
  • Loading branch information
entonbiba authored and katspaugh committed May 4, 2017
1 parent b65d9e9 commit 0066f2c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/webaudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ WaveSurfer.WebAudio = {
getPeaks: function (length, first, last) {
if (this.peaks) { return this.peaks; }

first = first || 0;
last = last || length - 1;

this.setLength(length);

var sampleSize = this.buffer.length / length;
Expand Down

0 comments on commit 0066f2c

Please sign in to comment.