3

I am developing a karaoke app in which i want to mix two audio streams in android application.

  1. The audio which will be played from the media player.

  2. The audio from the recorder.

I want to mix both these audio streams into one. Did research on this and got these open source libraries.

  1. https://www.ffmpeg.org/

  2. https://github.com/umair13adil/mp4parser

These two libraries can be used to merge the two audio streams.

And from stackoverflow i got this link in which he is telling to do this,

In order to mix two compressed audio file into a single compressed audio file, the following steps are required:

  1. decode the compressed file using a decoder to obtain the raw data (NO PUBLIC SYSTEM API available for this, you need to do it manually!).
  2. mix the two raw uncompressed data streams (applying audio clipping if necessary). For this, you need to consider the raw data format obtained with your decoder (PCM)
  3. encode the raw mixed data into a compressed MP3 file (as per the decoder, you need to do it manually using an encoder)

I want to know whether these steps are correct or not. Can anyone tel me how can achieve this merging of two audio streams into one.

hasan_shaikh
  • 1,434
  • 1
  • 15
  • 38

0 Answers0