pretrained-pipelines / assets /template.html
Hervé BREDIN
feat: update to latest pyannote and wavesurfer (#3)
57604a5 unverified
raw
history blame contribute delete
741 Bytes
<script type="module">
import WaveSurfer from 'https://unpkg.com/wavesurfer.js@7/dist/wavesurfer.esm.js'
import RegionsPlugin from 'https://unpkg.com/wavesurfer.js@7/dist/plugins/regions.esm.js'
var labels=[];
const wavesurfer = WaveSurfer.create({
container: '#waveform',
barGap: 2,
barHeight: 3,
barWidth: 3,
barRadius: 2,
});
const regions = wavesurfer.registerPlugin(RegionsPlugin.create())
wavesurfer.load('BASE64');
wavesurfer.on('ready', function () {
wavesurfer.play();
});
wavesurfer.on('decode', function () {
REGIONS
wavesurfer.play();
});
wavesurfer.on('click', () => {
play();
});
function play(){
wavesurfer.isPlaying() ? wavesurfer.pause() : wavesurfer.play();
}
</script>
<div id="waveform"></div>