diff --git a/src/drawer.multicanvas.js b/src/drawer.multicanvas.js index 11c7c1ca6..0062f4f82 100644 --- a/src/drawer.multicanvas.js +++ b/src/drawer.multicanvas.js @@ -259,7 +259,7 @@ export default class MultiCanvas extends Drawer { const gap = Math.max(this.params.pixelRatio, ~~(bar / 2)); const step = bar + gap; - let absmax = 1; + let absmax = 1 / this.params.barHeight; if (this.params.normalize) { const max = util.max(peaks); const min = util.min(peaks); @@ -321,7 +321,7 @@ export default class MultiCanvas extends Drawer { const offsetY = height * channelIndex || 0; const halfH = height / 2; - let absmax = 1; + let absmax = 1 / this.params.barHeight; if (this.params.normalize) { const max = util.max(peaks); const min = util.min(peaks); diff --git a/src/wavesurfer.js b/src/wavesurfer.js index af81c7083..14ff9deb7 100755 --- a/src/wavesurfer.js +++ b/src/wavesurfer.js @@ -27,6 +27,7 @@ import PeakCache from './peakcache'; * @property {string} backend='WebAudio' `'WebAudio'|'MediaElement'` In most cases * you don't have to set this manually. MediaElement is a fallback for * unsupported browsers. + * @property {number} barHeight=1 The height of the wave * @property {boolean} closeAudioContext=false Close and nullify all audio * contexts when the destroy method is called. * @property {!string|HTMLElement} container CSS selector or HTML element where @@ -172,6 +173,7 @@ export default class WaveSurfer extends util.Observer { audioRate : 1, autoCenter : true, backend : 'WebAudio', + barHeight : 1, container : null, cursorColor : '#333', cursorWidth : 1,