0

I want to receive incoming call automatically that was I done already now I want to play my own created sound to my caller rather than android will use its default mike..

Can is it possible to play our own sound after receiving incoming call?

I refereed this. Can anyone tell me is it possible now?

I searched lot related to this topic but still I am not able to find something useful.

If anyone know about this then please help me..

Thanks in advance.

Community
  • 1
  • 1
anddev
  • 3,144
  • 12
  • 39
  • 70

2 Answers2

0

I found this may be helpful for you

quote from: How to automatically answer call and play prerecorded sound out to the caller and DTMF on Android

"No, sorry, Android has no access to the in-call audio stream. Closest thing is if the device is in speakerphone mode, you can blend your audio into what the speaker plays, which may get picked up by the microphone."

Community
  • 1
  • 1
-1

As described here (http://www.krvarma.com/2010/08/detecting-incoming-and-outgoing-calls-in-android/), you should be able to detect this:

To detect the incoming call, we register a BroadcastReceiver for the action android.intent.action.PHONE_STATE. This will be broadcasted when there is a change in phone state. The receiving intent will have an extra string variable TelephonyManager.EXTRA_STATE which describes the phone state. If this state is TelephonyManager.EXTRA_STATE_RINGING then there will be another extra string variable TelephonyManager.EXTRA_INCOMING_NUMBER. This variable contains the incoming phone number. Note that this variable will not be present when the state is not TelephonyManager.EXTRA_STATE_RINGING.

Joel Martinez
  • 46,929
  • 26
  • 130
  • 185
  • Thanks for your reply.. I edit my question can you please check that now? Actually I already created Receiver but after that I want to play my own sound is it possible? – anddev Apr 04 '12 at 13:29
  • are you saying replacing the ringtone that Android uses with your own sound? If so, wouldn't it make more sense to just work with the SDK and set the ringtone? http://stackoverflow.com/a/1287415/5416 – Joel Martinez Apr 04 '12 at 13:32
  • No dear I think you are going into wrong direction. I don't want to set ring tone I want to play a sound as a caller tune but after call receiving. When incoming call will be received at the same time my caller can be able to listen the sound which is played by me from my cell-phone. – anddev Apr 05 '12 at 04:52