There are several problems with you.
a.) If there is metadata in the source files, you copy the metadata. In the combined file, this metadata (Id3v1 and Id3v2) will be present several times and worse, in those places where they should not be (Id3v1 should be located at the end of the file, Id3v2 at the beginning of IIRC). This can prevent the decoder from recognizing the file as corrupted (it can play the first section, and then hiccup in the unexpected metadata of the second part).
b.) Calculating the length of MP3s is not so simple, you would need to count the number of MP3 frames in the file. Since there is no header that reports the number of frames, the only safe way to do this is to scan the file sequentially (for example, decode). It used to be an expensive operation when entering MP3, so there were several ways to fix this (VBR header block and Id3 meta tags). If your player relies on them, he will always determine the length as soon as the 1st part.
c.) Even if you delete the metadata properly, you can concatenate MP3 streams using the same parameters (sample rate), some decoders may even have additional restrictions on the bit rate and type (mono / MS / Istereo, etc. .).).
You see, this can be done, but it is not trivial.
Durandal
source share