Question Asker
Question Asker

Reputation: 47

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

Is it possible to capture the speaker output in Android?

This would be for the purpose of determining, when listening to the microphone input, which sounds were generated from other apps and which originated from the user.

This is essentially to create an acoustic cancellation filter on the output of other apps, so their sounds don't interfere with the microphone input.

Upvotes: 3

Views: 3323

Answers (2)

TheBaj
TheBaj

Reputation: 1141

As of Android 10 you can use the AudioPlaybackCapture API for audio playback capture. https://developer.android.com/guide/topics/media/playback-capture

Upvotes: 3

10101010
10101010

Reputation: 637

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.

Upvotes: 1

Related Questions