Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Audio Android.Mixing a song and a voice recorded!

Tags:

android

audio

I am developing a karaoke app and i have been dealing with audio from android.I want an opinion on how can i save a single song from a voice recorded and another song playing in the background.

Thanks

like image 610
vas88y Avatar asked Nov 14 '22 20:11

vas88y


1 Answers

You can try FFMPEG Library for Android, consider using android wrapper. There are several SO answers of help

Audio song mixer in android programmatically

How to overlay two audio files using ffmpeg

FFmpeg on Android

You may want to check amerge and amix ffmpeg filters based on your needs

SoundPool is a good option if requirements can be met just by playing two audio streams together.

SoundPool can also manage the number of audio streams being rendered at once. When the SoundPool object is constructed, the maxStreams parameter sets the maximum number of streams that can be played at a time from this single SoundPool.

Also note Android - Lollipop version now supports multi-channel audio stream mixing

Multi-channel audio stream mixing means professional audio applications can now mix up to eight channels including 5.1 and 7.1 channels.

Multi-channel support

If your hardware and driver supports multichannel audio via HDMI, you can output the audio stream directly to the audio hardware.

like image 196
random Avatar answered Dec 13 '22 05:12

random