How can I send a pre-recorded (wav) file during a voice call?

I want to develop an application through which, if the caller calls you, the call must be answered automatically without user intervention, and the caller can hear a prerecorded voice that has already been recorded and saved. Sound file must be included. wav format.I was looking for help on google, but I found out that this is not possible in Android, but there are some Android apps that have the same functionality. Therefore, I think there is some possibility for this. Examine me if the question is wrong .I would appreciate it if someone could help me. I am using eclipse Helios with the ADT plugin. I tried the code below, but that didn't work. If someone knows the answer, please help me. I used a broadcast receiver to read phone state changes. In CALL_STATE_OFFHOOK I wrote the following code.

case TelephonyManager.CALL_STATE_OFFHOOK: Toast.makeText(context, "Call Picked..", Toast.LENGTH_LONG) .show(); Log.d("received", "Call Picked...."); final MediaPlayer mPlayer = MediaPlayer.create(context, R.raw.music_file); mPlayer.setAudioStreamType(AudioManager.STREAM_VOICE_CALL); mPlayer.prepareAsync(); mPlayer.start(); mPlayer.setOnErrorListener(new OnErrorListener() { @Override public boolean onError(MediaPlayer mp, int what, int extra) { // TODO Auto-generated method mPlayer.reset(); return true; } }); AudioManager am=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE); am.setMode(AudioManager.MODE_IN_CALL); am.setSpeakerphoneOn(false); am.setMicrophoneMute(true); Log.d("in call","sent audio"); mPlayer.reset(); mPlayer.release(); break; 
+7
source share
2 answers

Transferring sound to a phone call is not fully supported by the Android hardware.

+3
source

The “Answering Machine” from DevIndia Infoway is located in the game store. It works when playing mp3 when you turn on the speakerphone. So the other side will hear what is playing (and also if there are other noises in the room). Not really rocket science.

0
source

All Articles