Closed Archer-Thane closed 4 years ago
Thanks for your request. If I summarize it correctly, after converting the WAV file into an MP3 file, you want to append one MP3 file to another.
Both LAME
and node-lame
can only convert files but not edit them (cut, append, prepend...). To merge two MP3 files, you can e.g. use audioconcat.
hey guys, awesome project! I try to recieve data from microphone of a client, convert it to array buffer in client side, send it through socket connection, recieve it server side, decode the buffer which is recieved, and save it as a file. but the problem is that when I recieve the new buffer, previous mp3 file will destroy and new decoded file will "replace" instead of append. here is my code (I write just server side here since I feel client side is not useful. If needed, just let me know):
socket.on('transmitFile', function (data) { const decoder = new Lame({ "output": "demo.mp3" }).setBuffer(data); decoder.decode() .then(() => {}) .catch((error) => {}); });
when I open the folder which demo.mp3 is live in, I see that the size of this file (and obviously its content) is changing. how can I append it instead of rewrite it? thanks a lot