Record Android Audio Output

Record Android Audio Output

In Android 10, they have introduced Audio Playback Capture API using which we can capture the Audio being played by other applications. But it's not available in previous android versions.

An app X can also prevent any other app from listening, if that app hasn't added any constraint then this API can be used.

Android record audio output

After long reaches i found the solution.

  1. Bad solution : at first i use Visualizer.OnDataCaptureListener this listener provide 8 bit fft and

    waveform frequency , but wav and android audio form at least contain
    16 bit frequency , i save 8 bit frequency and played , this audio

    quality is low and audio contain many noise.

  2. Good idea is : Eery game and audio recoded app that record their audio output , they originally not recorded anything , they

    recoded which sound is played and they merge recoded file and
    created a audio file

Android recording an apps sound output

See below:

https://stackoverflow.com/a/25741006/850347
Seems to be currently there is no way to achieve this. I have read this article and it suggests to recompile the Android source code with some changes.

Or, you can use visualizer.

https://stackoverflow.com/a/25816052/850347
The closest API available to you for these purposes is Visualizer. Which only captures "partial and low quality audio content".

How to record sound in Android app

Without root, Android can't record internally (or say 'digitally') what is coming out of the speaker or the headphones. The reason might be copyright issues, so that it is not possible to produce digital copies of what is played back over the Android device.

Of course, you can record it with the internal microphone(s) if the signal is loud enough, but the loss of quality is significant. Additionally, you have background noise and the tapping noise of the finger tips of the user on your xylophone.

The best solution would be that you mix the samples corresponding to the keys programmatically and send the result to the speaker and at the same time into a sound file. Complicated, but optimal.

Is it possible to programmatically listen to the speaker output in Android?

You won't be able to capture the output stream, per this post :

How to capture output stream of audio in Android?

Unless there has been some change since six months ago, when this question was answered.

However, a workaround (which does not look good) is mentioned there.



Related Topics



Leave a reply



Submit