Is it possible to get access to the speaker signal on Android?
Asked Answered
C

2

13

Sending audio to the speaker for playback on Android is easy, but is it possible to get a copy of the actual final digital signal? Let's say I have 2 apps running "MyApp" and "SomeOtherApp". My app sends audio to the speaker, but so does "SomeOtherApp". "SomeOtherApp" is not my app - it's a 3rd party app. Is it possible to get a copy of the mixed audio signal which is played to the speaker by the OS? That is, the audio signal which is a mixture of the speaker signal from my app and the speaker signal from "SomeOtherApp".

To summarize: I am looking for a way to hook into the low-level audio path (HAL audio stream out - after mixing!) so I can get a copy of the "final" speaker signal (in real-time). Optimally, I would also like to hook into the low-level microphone path, but that's less of a concern right now.

Charade answered 15/7, 2016 at 18:23 Comment(1)
Got this one here: #14496144Mccaslin
M
3

Looks like the short answer is no.

Longer one is kinda. And sorta. But not really, as far as I know. Option 1: it might be a problem with respects to privacy. (not really a good option) Option 2: nobody thought it was needed, so did not build it into the system. Option 3: the amount of trouble shooting when programmers use the wrong source is just not worth it.

edit - You can, of course, record the input.

Mccaslin answered 27/10, 2016 at 13:1 Comment(0)
E
1

Checkthis one google example

Usage :

App will capture audio from android devices and playback on the same device; the playback on speaker will be captured immediately

*

Encouragement answered 2/11, 2016 at 13:25 Comment(1)
Looks promising, but due to: to verify it, it is recommended to "mute" the playback audio with a earspeaker/earphone/earbug so it does not get looped back. I think it uses the mic and a fast(er) way to play said audio. Would be nice to have some input of someone who has used this.Mccaslin

© 2022 - 2024 — McMap. All rights reserved.