It creates a voice portfolio where you can post wav, mp3 and so on.I would like to display the file in filereader.result, set the audio data to start with the range of the input element, cut it out for only 20 seconds, and save it to the database.
There was Blob.slice() in a close library that seemed feasible, but the argument was byte specification, not time.You can calculate the file size every second and apply it to the blob.slice argument, but I would like you to tell me about other libraries and tips that can easily trim files.
We look forward to your help.
I didn't actually try it, but the library simple-mp3-cutter introduced in How to cut a Audio mp3 Blob in JS in English SO seems to be able to cut mp3 at a specified time.
cutter.cut(blob, start, end, callback, bitrate);
blob
is the audio blob.
start
Start time in second.
end
End time in second.
callback
callback function (it is not possible to return data from async)
bitrate
is optional, default is 192
© 2024 OneMinuteCode. All rights reserved.