I have Integrated PJSIP with android. While making call in my application, the Speaker is working perfectly but Recording microphone volume is too low. My voice is not hearable by other side.
Note: But in some mobiles it's working properly.
Even i tried with adjustStreamVolume(), setStreamVolume(), setMode(),adjustVolume() methods to increase my volume level, it doesn't increase in anyway. Please give me a suggestion to solve this problem to increasing microphone Volume level in Android or from PJSIP.
Thanks in Advance.
It looks like to me setStreamVolume
and the like are more used for speakers rather than to control the microphone.
From the PJSIP docs, you can see there is a method called that could adjust the signal level received.
You can use it like the following, where volume is between 0
and 2.0
.
pjsua_conf_adjust_rx_level(0, volume);
I saw in a few places that you might need root access to modify this parameter anyway, or that you need to have a MediaTek chip.
What you can do instead is increase the gain from your stream directly. This answer shows you how you could do it, where the gain is also in the same range.
Problem is Microphone volume level is too low when our application access through microphone. When you got low volume, you need to check multiple things.
One of them is MODE OF THE AUDIO MANAGER when microphone is used.
Getting MODE of the Android Audio manager::
AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
long mode = am.getMode();
Log.e(TAG,"audio mode "+mode);
Setting MODE of the Android Audio manager::
AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
am.setMode(3);
You can access the mode of audio manager through this above code for your app.
There are
1.MODE_NORMAL
2.MODE_RINGTONE
3.MODE_IN_CALL
4.MODE_IN_COMMUNICATION
P.S. : Whenever you change the mode of the AudioManager, please change into MODE_NORMAL after using microphone otherwise it won't work once you restart the mobile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With