0

sorry I can't find any information on this. Doing a personal project using WebAudio API, getting microphone input, but the sensitivity is way too high. A friend told me to research the keywords Decibel Threshold/Gating but I can't seem to find any relevent information.. Anyone have any resources? I've referenced a lot of open sourced code so keep the terminology to the minimum please, THANKS!

Ranson Namba
  • 335
  • 1
  • 2
  • 15
  • 1
    usually you can adjust the mic levels in the device's volume settings. there's not (afaik) an API to do the same from JS, but you can transform the audio, normalizing it and/or setting a ceiling. – dandavis Apr 02 '15 at 21:53
  • Hrm, currently using WebAudioAPI to access the user microphone/get the Frequency level of input, was thinking that I could at the same time filter the input to only pick up above a certain HZ level or something similar – Ranson Namba Apr 02 '15 at 21:55
  • there are several ways to clean it up after capture, but the best results by far will be obtained by adjusting the hardware input level. – dandavis Apr 02 '15 at 21:57

1 Answers1

0

There's no way to turn down the hardware microphone gain from Web Audio API, so if it's actually clipping, the user needs to turn down the gain. You could potentially detect that it's clipping (by looking for sample values close to plus or minus 1), and ask the user to turn it down.

If it's not clipping, but is still too loud for your purposes, you can just run it through a gain node. Or if you want to turn it down only if it's over a certain level, you can run it through a compressor node.

aldel
  • 6,489
  • 1
  • 27
  • 32