chiro-canto/public/explore/spectrograms/scripts/script.js

11 lines
286 B
JavaScript
Raw Normal View History

2021-03-31 08:38:30 +02:00
var wavesurfer = WaveSurfer.create({
container: '#waveform',
waveColor: 'violet',
progressColor: 'purple'
});
wavesurfer.on('ready', function () {
wavesurfer.play();
});
let audio = document.getElementById('audio');
let file_path = audio.src;
wavesurfer.load(file_path);