How to adjust microphone sensitivity while recording audio in android

后端 未结 4 1590
清歌不尽
清歌不尽 2020-12-03 04:11

I\'m working on a voice recording app. In it, I have a Seekbar to change the input voice gain. I couldn\'t find any way to adjust the input voice gain.

I am using th

4条回答
  •  生来不讨喜
    2020-12-03 04:58

    Dynamic microphone sensitivity is not a thing that the hardware or operating system is capable of as it requires analysis on the recorded sound. You should implement your own algorithm to analyze the recorded sound and adjust (amplify or decrease) the sound level on your own.

    You can start by analyzing last few seconds and find a multiplier that is going to "balance" the average amplitude. The multiplier must be inversely proportional to the average amplitude to balance it.

    PS: If you still want to do it, the mic levels are accessible when you have a root access, but I am still not sure -and don't think it is possible- if you can change the settings while recording. Hint: "/system/etc/snd_soc_msm" file.

提交回复
热议问题