Improve Android Audio Recording quality?
Asked Answered
F

3

23

Is there any way to record audio in high quality?

And how can I read information that user is saying something? In Audio Recording application you can see such indicator (I don't know the right name for it).

Fanaticism answered 17/9, 2009 at 10:14 Comment(0)
U
18

For recording and monitoring: You can use the sound recorder activity. Here's a snippet of code:

Intent recordIntent = new Intent(
                MediaStore.Audio.Media.RECORD_SOUND_ACTION);
            startActivityForResult(recordIntent, REQUEST_CODE_RECORD);

For a perfect working example of how to record audio which includes an input monitor, download the open source Ringdroid project: https://github.com/google/ringdroid

Look at the screenshots and you'll see the monitor.

For making the audio higher quality, you'd need a better mic. The built in mic can only capture so much (which is not that good). Again, look at the ringdroid project, glean some info from there. At that point you could implement some normalization and amplification routines to improve the sound.

Unconformable answered 17/9, 2009 at 12:56 Comment(2)
what is the REQUEST_CODE_RECORD ?Agee
A local constant that I use to determine which result I'm getting back from which request on the onActivityResult().Unconformable
T
31

At the moment, a big reason for poor audio quality recording on Android is the codec used by the MediaRecorder class (the AMR-NB codec). However, you can get access to uncompressed audio via the AudioRecord class, and record that into a file directly.

The Rehearsal Assistant app does this to save uncompressed audio into a WAV file - take a look at the RehearsalAudioRecord class source code.

The RehearsalAudioRecord class also provides a getMaxAmplitude method, which you can use to detect the maximum audio level since the last time you called the method (MediaRecorder also provides this method).

Thora answered 23/10, 2009 at 18:22 Comment(2)
hello,Stjepan Rajko ,in Rehearsal Assistant app,i cannot find the ,org.urbanstew.VolumeEnvelopeView ,could you tell me where it is?Pitsaw
Other codecs are also available in Android what about them developer.android.com/reference/android/media/…Mercurous
U
18

For recording and monitoring: You can use the sound recorder activity. Here's a snippet of code:

Intent recordIntent = new Intent(
                MediaStore.Audio.Media.RECORD_SOUND_ACTION);
            startActivityForResult(recordIntent, REQUEST_CODE_RECORD);

For a perfect working example of how to record audio which includes an input monitor, download the open source Ringdroid project: https://github.com/google/ringdroid

Look at the screenshots and you'll see the monitor.

For making the audio higher quality, you'd need a better mic. The built in mic can only capture so much (which is not that good). Again, look at the ringdroid project, glean some info from there. At that point you could implement some normalization and amplification routines to improve the sound.

Unconformable answered 17/9, 2009 at 12:56 Comment(2)
what is the REQUEST_CODE_RECORD ?Agee
A local constant that I use to determine which result I'm getting back from which request on the onActivityResult().Unconformable
M
0

I give you a simple answer.

  1. for samplerate, about the quality, 48000 is almost the same as 16000.
  2. for bitrate, about the quality, 96Kbps is much better than 16Kbps.
  3. you can try stereo(channelCount = 2), but make little change.

So, for android phones, just set the audio bit rate bigger, you will get the better quality.

Mendive answered 17/3, 2022 at 15:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.