Background Audio for a Call in Progress - Possible?

放肆的年华 提交于 2019-12-12 04:36:51

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/15588009/background-audio-for-a-call-in-progress-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!