0

How to play a prerecorded file on call in Android? Its possible to play with speaker phone mode, but it gives a noisy output. Is there any alternative?

tvshajeer
  • 1,299
  • 2
  • 12
  • 26

1 Answers1

0

There is no problem to play files that are installed on the device. You can open the file from the machine by the appropriate applications. And it is also possible to write code to play the files, do this: 1. Need to make sure the files are correct and appropriate format. 2. Need to ensure that access to read the files. 3. Write the appropriate code.

Miki Franko
  • 687
  • 3
  • 7
  • I just tried like this 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 couldn't able to listen the audio played by the receiver phone. – tvshajeer Nov 27 '14 at 05:39
  • 1
    You mean is when you are on a call, play the file, and that the other side will hear it? – Miki Franko Nov 27 '14 at 09:18
  • yea. This is what i want to do. can we make speaker output to mic input. – tvshajeer Nov 27 '14 at 10:18