I want to make an app to record using MediaRecorder with certain volume set by user.
Is there any possibility to set the volume when recording? I try to see in MediaRecorder API but i can't find setVolume or something like that..
Is there any work around? Or any post process that i have to do to make it happen?
Thanks.
You can not do it while recording, but you can set the volume while playing with the setVolume(float, float) method on MediaPlayer.
Related
I'm making VoIP app on Android, playing PCM audio like in Play PCM stream in Android
On my phone (LG V20, Android8) it works, but when I'm using volume buttons, it doesn't show Call volume and volume control doesn't work for my audio at all.
How to make my audio "Call audio" and be controlled by standard volume controls?
You have to take AudioFocus by calling "requestAudioFocus()": https://developer.android.com/reference/android/media/AudioManager#requestAudioFocus(android.media.AudioFocusRequest) and set VOICECALL Stream in the Constructor of the Request.
In the end, I was missing:
Permission - MODIFY_AUDIO_SETTINGS
Setting AudioManager mode to MODE_IN_COMMUNICATION
I'm surprised it wasn't in tutorials, maybe it was changed in later SDK.
How can I control the volume of a background sound?
I'm making a game, and in some states I want to increase or decrease the background sound.
I have tried some things with MediaPlayer and SoundPool, but it did't do what I wanted.
I dont want to change the phone volume, but the volume of the sound. Is this possible? If yes how?
Cheers
You haven't told use what "some things with MediaPlayer and SoundPool" means, or shown us any code, so it's hard to say exactly what the problem might be.
If you want to make the volume keys modify the volume of your app's music rather than the voice call volume, you might be missing a call to setVolumeControlStream (e.g. setVolumeControlStream(AudioManager.STREAM_MUSIC);).
Refer to "Controlling Your App’s Volume and Playback" in the Android developer documentation for more information.
If you're using the MediaPlayer setVolume method, then keep in mind that the maximum volume you can set is 1.0 (i.e. the original volume of the audio data you're playing).
I'm not that familiar with android programming and would like to set the audio volume while (or before) recording a video with MediaRecorder. Is there a way to do that? Or is there a better way to record a video with variable audio volume, instead of using MediaRecorder?
There is no way to set volume while recording using MediaRecorder. But you can set volume while playing using MediaPlayer by using the method setVolume(float, float)
I am doing audio recording using MediaRecorder, but unfortunately when I playback the recorded audio, I have media with a very low volume. I don't hear anything (almost anything).
Is there any possibility to increase recording volume? Like setVolume() when we record?
I try to see in MediaRecorder API but i can't find setVolume or something like that..
Is there any work around?
Thanks.
Well after some r&d and googling i found is there is no specific volume for mic. when you are recording that takes media volume as mic volume.
So to set it, Goto
Settings->Sound->Volume->
and check Media volume.
If you wan to Record in the full Volume then keep Media Volume high and if you want to record in low Volume then keep Media Volume Small.
AIK there is no other sollution.
So please do it for your case.
I'm using the simple app shown in the Android documentation to play around with recording and playing audio. Just to add a small feature, I want to get the volume of the microphone while it's recording to move a bar like how the voice recognition will fill the microphone while you are speaking into it. I looked around online, but no one seems to have a definitive answer, could someone point me in the right direction? Thanks!
i think there is no specific volume for mic. when you are recording that takes media volume as mic volume.