Say I make a call to som开发者_JAVA百科eone with my android phone. Is it possible to play some audio file into the call?
I just tried like this
if(state==TelephonyManager.CALL_STATE_OFFHOOK){
AudioManager am = (AudioManager) pccontext.getSystemService(Context.AUDIO_SERVICE);
am.setMode(AudioManager.MODE_NORMAL);
am.setSpeakerphoneOn(true);
MediaPlayer mp = MediaPlayer.create(pccontext, R.raw.beep);
mp.start();
}
But its not working in MODE_NORMAL. When I tried with MODE_IN_CALL phone is playing the audio but caller on the other side is not able to listen the audio played by the receiver phone.
Unfortunately, it is not possible, it is an Android security limitation.
加载中,请稍侯......
精彩评论