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.

user1884325
  • 2,530
  • 1
  • 30
  • 49

2 Answers2

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.

Community
  • 1
  • 1
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

*

O_Z
  • 1,515
  • 9
  • 11
  • 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. – Flummox - don't be evil SE Nov 03 '16 at 08:03