Is Android capable of managing microphone/input volume?

17,951

You can't directly set the recording volume, but you can change what you do with the byte data you get from AudioRecord (look at the AudioTrack class for reducing the volume of the track)

Edit: I forgot to mention that if you're having trouble with volume spikes you can look at automatic gain control. Some devices activate it automatically, but you can manually enable it.

Share:
17,951
treelzebub
Author by

treelzebub

Updated on June 07, 2022

Comments

  • treelzebub
    treelzebub almost 2 years

    I've searched everywhere, including the RootTools source. I can't find anything that manages the microphone, apart from muting it altogether. And there are no hints inside the AudioRecorder.setMicrophoneMute(bool) method either...

    There are a few posts about this issue, but none of them ever go anywhere (through no fault of OPs'). Is it (legally) possible to override the OS and get to the mic hardware directly or something?

    Thanks,
    -tre

  • treelzebub
    treelzebub almost 10 years
    It's not gain spikes specifically that prompted my question. It's the possibilities opened up by allowing the user to change input volume. My first 2 thoughts are: 1) An app for LOUD TALKERS who are always bursting their friends' eardrums on the phone; and 2) Concert recording, where, if you could just turn down the input gain to 3 from 10, the music would actually be audible. Automatic Gain Control is exactly what I would like to override: developer/user control over microphone gain before it is recorded/transmitted.
  • Selali Adobor
    Selali Adobor almost 10 years
    It's been a feature long sought after by others, especially people looking to make advanced musical applications (in fact it's an open issue on AOSP's issue tracker), but it's not that straight forward on Android, the range of issues that have to be dealt with includes security concerns, details of how different manufacturers are giving access to the microphone, etc.