Skip to content

Commit

Permalink
plugins: document spectrogram labels option
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra committed Mar 6, 2019
1 parent 888cc5e commit 9244bd7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion example/spectrogram/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ document.addEventListener('DOMContentLoaded', function() {
cursorColor: 'navy',
plugins: [
WaveSurfer.spectrogram.create({
container: '#wave-spectrogram'
container: '#wave-spectrogram',
labels: true
})
]
};
Expand Down
4 changes: 3 additions & 1 deletion example/spectrogram/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ <h4>Quick Start</h4>
plugins: [
WaveSurfer.spectrogram.create{
wavesurfer: wavesurfer,
container: "#wave-spectrogram"
container: "#wave-spectrogram",
labels: true
})
]
});
Expand All @@ -109,6 +110,7 @@ <h4>Options</h4>
<li><code>container</code> - <em>required</em> - the element in which to place the spectrogram, or a CSS selector to find it.</li>
<li><code>fftSamples</code> - number of FFT samples (<code>512</code> by default). Number of spectral lines and height of the spectrogram will be a half of this parameter.</li>
<li><code>frequenciesDataUrl</code> - URL to load spectral data from.</li>
<li><code>labels</code> - Whether or not to display frequency labels.</li>
</ul>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/plugin/spectrogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ const FFT = function(bufferSize, sampleRate, windowFunc, alpha) {
* which to render
* @property {number} fftSamples=512 Number of samples to fetch to FFT. Must be
* a power of 2.
* @property {boolean} labels Set to true to display frequency labels.
* @property {number} noverlap Size of the overlapping window. Must be <
* fftSamples. Auto deduced from canvas size by default.
* @property {string} windowFunc='hann' The window function to be used. One of
Expand Down

0 comments on commit 9244bd7

Please sign in to comment.