Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android call with custom voice mp3 file

I'm new in Android development (for instance I know that in iOS it's not possible).

I know, that to just make a call I need:

Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + bundle.getString("mobilePhone")));
context.startActivity(intent);

But is it possible to call a phone xxxxxxxxx and then instead of voice the other user should hear a voice file (for instance mp3 file placed in my Android project)? So the only task of the application is to call a number, to play a file and then to stop a call.

Is it possible with Android?

like image 252
Paul T. Avatar asked Oct 31 '22 18:10

Paul T.


1 Answers

I'm afraid this is not the answer you are looking for:

There are currently no way to send data to a ongoing call. The google havn't released any API for this functionality. You can only control a call in the sense of ending, muting, parking etc. like this. It is also possible to record calls, however, this does not happen by using the any class in the telephony package directly instead by using the MediaRecorder

Found this SO answer describing the issue closer. It is simply not possible, in most cases not even using NDK. I'll mark this a duplicate, since the answer already exists.

For more curious people, i recommend reading this SO answer.

like image 156
Rawa Avatar answered Nov 11 '22 09:11

Rawa