I am trying to stream voice/audio (two way) between two Android devices Tablet and Mobile (over java sockets).
The Tablet can play received audio(voice) clearly, but the Mobile plays received audio as noise.
Then i set this audio mode in the code on tablet:
audioManager.setMode(AudioManager.MODE_IN_CALL);
This now results in Mobile receiving clear voice. But the tablet goes silent, it does not play the received audio (or rather its not audible).
I am not sure what combination (if any) of AudioManager mode i should use here?
It's possible to handle the sound you want to play as
Alarm
.Create a new class named
AlarmController
and try this code.This worked for me on Android 4.4.2 (Huawei ascend P7) with each system volume (Media, Ringtone, Alarm) set to 0.
I hope this works for you. :)