How to combine audio with different bit rates and sampling rates

I have requested two APIs that return data in mp3/mpeg format with different bitrates and sampling rates. I have tried two methods of stitching. The first is to connect two buffer segments directly, and the second is to use lame to convert the data into a unified format. But there is only one sound, and the following code allows me to use node to convert two pieces of buffer through Lame in a uniform format, and then use Buffer.concat to piece it together. Are there any students who have done this? how should they be spliced in the correct way? The metadata for both of them looks like this.

   


has the problem been solved

Menu