Closed shivrajsa closed 7 years ago
You'll need an encoder for that! mp3.js is just a decoder.
@fasterthanlime my each MP3 file is encoded in base64 format. And I want to create single MP3 file by joining sequence of such MP3s with MIDI protocol.
I posted this question here, because I think authors of audiocogs libraries are expert in this area and may guide me to correct direction / steps to achieve that.
Yep! And the first step is: you need an mp3 encoder.
You'll basically need to:
There's really no way around it, MP3 files can't be concatenated in compressed form (even less overlaid on top of one another!)
Actually you can just concatenate MP3 files in compressed form. It's not pretty, but if all the MP3 files are complete (no partial bit reservoir at the beginning) and are similar (number of channels, maybe bitrate mode and bitrate) or if you have a decent decoder, it should work. There may be gaps of silence or glitches in between files, and timestamp calculations by the player may be incorrect. This works because the MP3 format was designed to be self synchronizing and tolerant of errors in the stream.
Actually you can just concatenate MP3 files
Let me revise my comment with "really shouldn't" then.
More importantly, concatenation isn't enough for what the OP wanted to do.
By the way, we finished up that discussion by e-mail, so I'm going to close this issue since it's not directly an mp3.js issue.
I am wondering if this is right place to ask this question, but I think at least my question will be directed to experts of this topic
I have developed an application using MIDI.js where I am playing sequence of notes [ small base64 MP3 files ]using MIDI protocol. So I have two types of data
I want to build single MP3 file using this data. Could you please guide to progress on this requirement.