I am currently trying to make a web editor allowing users to easily adjust basic settings to their audio files, as a plugin I\'ve integrated wavesurfer.js as it has a very neat
Interesting question. First word that comes to mind is ffmpeg. I can't talk from experience but if I was trying to achieve this I would approach it like:
Let's assume you select a region of your audio track and you want to copy it and make a new track out of it (later maybe just appending it to an existing track).
getSelection()
method provided by the nice wavesurfer.js library. This will give you startPosition()
and endPosition()
[in seconds].Note that if you plan to copy and paste many regions to piece up a new track, making this in the backend all the time will probably make no sense, and I guess I'd try to look for a client-side JS approach.
I hope this is helpful at least for an easy use case, and gets you started for the rest ;)
Update This might be worth reading.
Web Audio API
, tutorial here.