Replies: 1 comment 5 replies
-
<div id="waveform">
<!-- the waveform will be rendered here -->
</div>
<script type="module">
import WaveSurfer from 'https://unpkg.com/wavesurfer.js@7/dist/wavesurfer.esm.js'
const wavesurfer = WaveSurfer.create({
container: '#waveform',
waveColor: '#4F4A85',
progressColor: '#383351',
url: '/audio.mp3'
})
wavesurfer.on('interaction', () => {
wavesurfer.play()
})
</script> |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I want to use wavesurfer.js, but none of the examples I can find work.
Would it be possible to give an example of how to create an html page that incorporates a wavesurfer.js player that plays a publicly available audio file? Including all of the steps that need to be done, and settings, and CORS, or whatever that is?
The examples here didn't work for me: https://codepen.io/_kurene/pen/XWzBpWm, https://hassancorrigan.com/blog/create-a-soundcloud-audio-player-with-wavesurfer-js/
The example scripts on this site are just javascript chunks, apparently. I don't know how to use them in a webpage.
So please can someone provide a working example for people who are not javascript developers?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions