Reputation: 6970
I need to record audio file in Android, but i have low volume problem. The output track is has so low volume.
How can i increase recording volume ?
Is it possible ?
I use MediaRecorder
UPDATE
I use this code:
AudioManager audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
audioManager.setMode(AudioManager.MODE_NORMAL);
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,
audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC), 0);
is there any error that decrease volume ?
Recorder code:
recorder.setAudioSource(MediaRecorder.AudioSource.MIC); // CHANGE THIS ?
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(outputAudio);
recorder.setOnErrorListener(errorListener);
recorder.setOnInfoListener(infoListener);
recorder.setMaxDuration(Integer.parseInt(getString(R.string.max_mills)));**
Upvotes: 0
Views: 3694
Reputation: 22527
From what I understand there is no way to do this while recording, it all depends on your mic. But while playing, you can use the setVolume(float, float) method on MediaPlayer to increase the volume.
Upvotes: 1