agora.io Android SDK: how to adjust microphone volume - android

I've integrated the Agora android SDK into my app. In the video chat channel, some of my testing android devices have very low microphone volume (eg, Pixel 2 / 2 XL), is there a way to always set the microphone volume to the highest?
Thanks in advance!

You can take a look at the following guide on how to control the volume: https://docs.agora.io/en/Video/volume_android?platform=Android.
In particular, to control the recording volume, you will need to do the following:
int volume = 200;
// Sets the volume of the recorded signal.
rtcEngine.adjustRecordingSignalVolume(volume);
400 is the highest possible value for the volume.

Related

Low call volume using dedicated phone number with Twilio Programmable Voice Android

Tried experimenting with different audio focuses: AUDIOFOCUS_GAIN_TRANSIENT, AUDIOFOCUS_GAIN
Tried multiple Audio manager modes: MODE_IN_COMMUNICATION, MODE_IN_CALL
Call volume is noticeably quieter than a normal phone call.
All volume levels are set to max.

Audiotrack setVolume - minimum value

I am writing a simple app for testing hearing and I am generating pure tones with Audiotrack. Because it is an app for testing hearing I am using VERY low volume levels to play these tones.
To set volume I use audiotrack's setVolume(float volumeValue) method, where volumeValue = 0-1.
I noticed the lowest volume I can get a device to play is about ~ 5.011872E-5. If I try to play sound with lower volume - e.g. 4.466836E-5, the sound is not played by the device. There is no error, just simply device does not play it.
Is it normal? Is there some kind of minimum limit level for Audiotrack volume value? Or maybe it's hardware connected issue - device cannot reproduce such quiet sounds?
You need to setVolume as two digit float value for example 0.02f.

How to adjust microphone volume in Android programmatically

Is there a way to increase/decrease the input volume of the Android microphone. I did some research on Google as well as StackOverflow but didn't find a suitable answer.
Here are some links:
How to adjust microphone volume in android?
Adjust Microphone Recording Volume
Is Android capable of managing microphone/input volume?.
Please provide any help/reference.
I had a certain problem where I had to increase the volume (gain) of the sound and also filter out some frequencies I used TarsosDSP library for android it has a particular class called GainProcessor where you can adjust the sound accordingly. Hope it helps.

Increase volume of recording Android AudioRecord

I'm using AudioRecord and lame to record mic input to a mp3 sample for 12 seconds. The audio is recorder as expected but I realized the volume is too low.
Is there a way to increase the volume of the recording?
There is no gain settings in the audioRecord class to play with, so you cannot control the volume of the audio being recorded. The low volume of the audio is related to the hardware and varies from device to device. Here are a few options you can try.
1) try opening in the audio record in different modes and see whats works best .
check - http://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html
2) in audio record you get the raw PCM buffers. You can write a simple code/function to shift the bits (8/16 bits per channel) left or right to double or halve the gain. (Think of it as a very crude volume control)
3) try searching the net for more complex digital gain techniques for a smoother control.
There are many implementations. (There are proprietary techniques as well)
Check:
How to adjust microphone sensitivity while recording audio in android
you can also simply increase the volume of the device:
AudioManager am = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);
int previousVolume = am.getStreamVolume(AudioManager.STREAM_MUSIC);
am.setStreamVolume(AudioManager.STREAM_MUSIC, 10, 0);
{... do your things ... }
am.setStreamVolume(AudioManager.STREAM_MUSIC, previousVolume, 0);
In my case this was an easy fix and it worked with the rest of the application.

Get Sound volume size of android : Unity3d

I have developed game in unity3d.
In that game, i have given option for setting sound volume sound which affects my game sound object only, This does not relate with the android sound setting.
But i just want to check whether my android device is set to mute or not. If my device setting is mute then i will keep my game sound volume size value to 0.
But i am not getting the way to find the android device sound status,..if anyone is having idea then please guide me.
Thanks in advance for your support and help..
You can get the level of sound from your device this way:
AudioManager manager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
int levelSound = manager.getStreamVolume(AudioManager.STREAM_MUSIC);
You need to know the stream you are using, normally Music for any multimedia sound (music, games, films, etc...)
You can check also this, to know the mode of the phone right now:
manager.getRingerMode();

Categories

Resources