37

I am developing an android application that must play an audio file during a call and the other party should hear it.

Is there any way to do this in android? I searched for it by last 2 months, but no idea. If any of you crossed the same problem, please share your ideas with me.

9
  • 3
    thanx for ur reply, but i havent asked anything about new call events, i want to play an audio file in an existing call , is it possible?
    – Srinivas
    Jan 9, 2012 at 6:09
  • 21
    This got closed as "too broad". What is too broad about this question? I find it to the point and quite specific. May 17, 2017 at 15:20
  • 2
    The close reason is false. I just searched for this exact point and Google returned as #1 result. Would I be the only one who believes that because it is not possible today, that it very well could be possible tomorrow?
    – qxotk
    Jun 4, 2017 at 20:03
  • 1
    the close reason is false, however, if nothing changes today in 2018, it shall be remain closed. Nov 21, 2018 at 7:03

4 Answers 4

35

While this is a old post, thought would share the experience i have so far with trying this..

In the simplest sense, no.. you can not But there are "some" exceptions here, but if your looking to build an application for the public.. This is not for you... its device specific...

WHY WE CANT PLAY AUDIO DURING A CALL

The simple fact is the microphone / input audio stream during a phone call is not able to be pre-processed or replaced with another stream of any form.

So simply while one would think its easy to use media during a call, it simply is not possible due to the way the android system processes the audio.

SO WHAT ARE THE WAYS PEOPLE HAVE DONE IT??

Well lets start simple... They have not, they have managed to hack or use a exploit to do so or some device specific programming to do this.. ONE CODE WILL NOT FIT ALL HERE

As far as i have been able to see and research on this topic, there are means by using adb or messing with codecs and the kernel.. But simply i have not looked to far into this as i am ideally seeking a solution that works on all devices and is only restrictive by the API being used.

WHY DID ANDROID/GOOGLE/HARDWARE DO THIS TO US???

Well your guess is as good as mine, but one would think its to do with the way this can be exploited.. Having a application to mask your voice, a rouge application that answers calls for you and so on.. Simply i myself can see plenty of good reasons why to not allow it, but really wish it was allowed/possible because with any technology people will be screwed over with anyway.

ALTERNATIVE METHODS FOR THIS????

Well this is the tricky question, simply there is no true alternative if your core requirement is to play an audio stream on a live call to the other party from your phone... Some people revert to using VoIP for redirecting and handling this or other logic methods..

APPLICATIONS WHO CLAIM TO DO THIS!?!?!

Firstly, download one and test it with two phones.... Does the sound truely get streamed along with your normal audio to them or does it just appear faint/broken up or not just there at all.

The only true known method that works on all android devices, is using the loud speaker.. Which also makes me wonder why Elias was down voted for this as technically its the only answer that is a valid way of doing this instead of people simply saying "No, Its Not Possible"..

The only applications to truly have this working in any way, are the ones who are targeted for set devices.. They will not work with a no-name brand or in general with all android devices. Read the reviews and find out for yourself

SO WHAT DO WE DO IN THE MEAN TIME ............... wish that it was possible ............

4
  • any example how do it with adb, for example my phone connected to windows or linux pc with usb and I want to send music or speech. is it possible with adb?
    – user924
    May 25, 2018 at 11:07
  • I wanted to write an app to send a fax directly from the phone itself no additional resources needed.. guess that's not possible. thanks android!
    – Dan
    Jun 1, 2018 at 16:14
  • What about root access?
    – beppe9000
    Jun 25, 2019 at 11:44
  • I so not believe root access will change this, you would have to modify a distro of android and use that. Root access only allows admin rights as such, but the core still has this safety in place.
    – Angry 84
    Jun 30, 2019 at 2:43
23

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.

from the official docs.

1
  • 1
    Sorry mate :/ You can roll you own android distro and program this feature if you really need it. Jan 10, 2012 at 5:59
18

You can play audio to speaker during the call. Then the microphone will get the audio. Apparently, you can't play music while the phone is turned on.

If you're near a PC, however, you can run a wire from the PC sound card to the microphone jack. I haven't tried it yet, but don't see why it wouldn't work.

3
  • 5
    I have up voted this due to this being actually technically correct, While there is no software way.. THIS IS THE ONLY TRUE KNOWN way... Please read my answer if you disagree and prove otherwise.
    – Angry 84
    Feb 11, 2015 at 7:40
  • 2
    can you provide an example please?
    – Silvia H
    Apr 4, 2015 at 21:33
  • 1
    If seeking an example of a wired audio solution from another audio source, perhaps the electrical engineering SE could have something.
    – qxotk
    Jun 4, 2017 at 20:05
7

As far as I recall this has been discussed on the Android SDK mailing list - and the answer is:

No - there is no way to play a sound file to the other party while placing a call.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.