use decibels for mic calibration slider

This commit is contained in:
Marks Polakovs 2020-05-10 13:10:13 +02:00
parent ee58335112
commit e443719bed
3 changed files with 8 additions and 5 deletions

View file

@ -286,7 +286,10 @@ export class AudioEngine extends ((EngineEmitter as unknown) as {
}
setMicCalibrationGain(value: number) {
this.micCalibrationGain.gain.value = value;
this.micCalibrationGain.gain.value =
value === 0
? 1 :
Math.pow(10, (value / 10));
}
setMicVolume(value: number) {

View file

@ -83,7 +83,7 @@ const mixerState = createSlice({
open: false,
volume: 1,
gain: 1,
baseGain: 1,
baseGain: 0,
openError: null,
id: "None",
},

View file

@ -124,9 +124,9 @@ export function MicTab() {
<div>
<input
type="range"
min={1.0 / 10}
max={3}
step={0.05}
min={-24}
max={24}
step={0.2}
value={state.baseGain}
onChange={(e) =>
dispatch(MixerState.setMicBaseGain(parseFloat(e.target.value)))