Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to play an audio file on a voice call in android [closed]

Tags:

android

audio

I am developing an android application which 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.

like image 847
Srinivas Avatar asked Jan 09 '12 05:01

Srinivas


People also ask

How can I play audio during call in Android?

Turn on the hands free function of your phone. Create a media player, set the media source, set the volume to 1.0f (highest) and call player. start() . If the microphone and speakers on the phone are of reasonable quality, the other party to the call will hear the music.

How do you play a sound on a call?

Glorious. have you tried having the application open that creates the sounds you want (such as a soundboard) or having your music player (android os, or other) open while the phone call is active? hold-homekey switch to the sound app and play the sound.


1 Answers

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 ............

like image 87
Angry 84 Avatar answered Oct 07 '22 10:10

Angry 84