-
Great looking project. I was wondering if I could leverage it for a broader use case, or whether you think better to do separately. Example situations:
I know its not what you project was designed for, but I was curious if you thought feasible or not - otherwise I get to write it all again from scratch! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You could probably shoehorn other media types into wavesurfer by making them mimic an HTML audio or video element. Something like class CustomMedia extends Audio {
play() { ... }
pause() { ... }
get currentTime() { ... }
set currentTime() { ... }
get duration() { ... }
addEventListener() { ... } // probably the trickiest part
} and then pass it to wavesurfer like this: const wavesurfer = WaveSurfer.create({
container: '#container',
media: new CustomMedia()
}) Regarding slicing audio into clips, you can do it with Web Audio (search in the issues of this repo, there were many questions about this with some solutions provided). |
Beta Was this translation helpful? Give feedback.
You could probably shoehorn other media types into wavesurfer by making them mimic an HTML audio or video element.
Something like
and then pass it to wavesurfer like this:
Regarding slicing audio into clips, you can do it with Web Audio (search in the issues of this repo, there were many questions about this with some solutions provided).