Audio control issues in libjingle_peerconnection for Android on some devices (like N4)

156 views
Skip to first unread message

Andrew Benton

unread,
Feb 10, 2014, 12:49:24 AM2/10/14
to discuss...@googlegroups.com
Hello all, I've been trying to solve a few audio quality issues in an Android app I'm building that relies on libjingle_peerconnection.jar and libjingle_peerconnection_so.so. The issues fall under two categories:

1. Controlling volume of audio playback streams and routing audio to the proper speaker (earpiece vs speakerphone)
2. Microphone recording volume

Leaving aside #2 for now, has anyone else had trouble using Android java APIs (AudioManager etc) to route audio? Specifically on my Nexus 4 I cannot get audio to route to the earpiece, no matter how many times I call audioManager.setSpeakerphoneOn(false). And there doesn't seem to be an API in libjingle_peerconnection.jar to control where audio is routed.

Secondly, using the volume control buttons doesn't affect the volume of audio playback, so it seems like audio is generally being routed in a strange way.

If anyone has experienced something similar and figured out how to get this working I would be forever grateful for an explanation.

Cheers,
amb

hu lingyun

unread,
Jun 10, 2014, 9:45:21 PM6/10/14
to discuss...@googlegroups.com
i had same problem.  It works well on some devices. But it seems have no benefits with openSL any more. 

i had use followed code:
audioManager.setMode(isWiredHeadsetOn ? AudioManager.MODE_IN_CALL : AudioManager.MODE_IN_COMMUNICATION);
audioManager.setSpeakerphoneOn(!isWiredHeadsetOn);
Reply all
Reply to author
Forward
0 new messages