1

I am writing a android app which is supposed to play back a audio file when a call is in progress coming from a specific number .. I tried many approaches.. but all went in vein

  1. Separate Thread
  2. Listener on Telephone service
  3. starting a service in parallel

can any one please help me how to proceed regarding this ?

Update :

I am able to play a mp3 file on call recieve and i am able to play it load on speaker.. but how ever loud i play the calling party is not able to listen to it.... is there anyway i can push the speaker stream to call stream

sunil
  • 177
  • 2
  • 12

1 Answers1

2

From the api doc here

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.

So from this and lots of other so answers we can conclude that we can not play an audio during a call process.

But a long time ago from a personal experience with a handset I got a result where the audiotrack was playing while there was a call established and both the voices were heard at the same time. So I think this depends on handsets if it allows it then you can play.

You can try another thing experimentally. play the audio using a different route ( speakerphone or bluetooth).

Another option is to build your custom android build

stinepike
  • 54,068
  • 14
  • 92
  • 112