I am trying to use the android.net.rtp library to create a VoIP application. Its audio stream can be either sent or received correctly.
My problem: the phone speaker of the called phone is working fine, but the headset is turned off all the time (even if I turn off the speaker).
My code is:
AudioManager Audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE); Audio.setMode(AudioManager.MODE_IN_COMMUNICATION); Audio.setSpeakerphoneOn(true); Audio.setMicrophoneMute(false); sender = new RtpStreamSender(null, "169.0.199.19", AudioCodec.PCMU);
source share