7

I have a rather tricky question this time.
I want to know how to Inject audio to microphone source during a call.
I know I have read dozens of topics here and there that states "it's not possible", "don't bother" etc..
But there are many things made impossible for us dev's by Android staff and we always managed to come up with a work-around-it.
For example, this time the easiest solution would be to play the audio via speaker with max volume, do a noise cancellation and hope for the best. ;)

Shadow The GPT Wizard
  • 66,030
  • 26
  • 140
  • 208
Phoenix666
  • 183
  • 1
  • 14

2 Answers2

7

From the official documentation:

Note: You can play back the audio data only to the standard output device. Currently, that is the mobile device speaker or a Bluetooth headset. You cannot play sound files in the conversation audio during a call.

The only thing I could think of would be to somehow interleave the call sound and the sound you want to play, but you don't have direct control over the call sound, so this is likely impossible.

It looks like this may change in 3.3, but it's currently not possible to do without using the NDK and/or writing your own distro of Android.

Sorry! :(

Codeman
  • 12,157
  • 10
  • 53
  • 91
  • Not my own distro of android ;) but I'll definitely take a look at ndk. I hope it works... – Phoenix666 Aug 12 '11 at 17:55
  • Glad I could help. As a new member, remember to upvote and mark as correct answers that answer your question to complete the thread. Thanks! :) – Codeman Aug 12 '11 at 18:01
0

But what are you trying to achieve? Are you trying to implement some kind of answering machine? The only way you could inject audio during a call is if you release your own android version. Download the sources, modify them, and release. Good luck :)

  • Yes, an answering machine... or Playing music for caller when the provider does not support this... there are tons of uses u know... – Phoenix666 Aug 12 '11 at 17:57