Disable automatic gain control on microphone

AGC really makes the soundqulity way worse than it could be.
Especially since it is so noticeable when entering a Jitsi where AGC is disabled (and suddenly some people sound much better).

In the long run, this should probably be configurable. On the other hand the setting changes the audio _going out_ from a user, so it might be hard for him to judge which settings are a good or a bad idea…
This commit is contained in:
TabascoEye 2021-01-30 02:13:03 +01:00 committed by Thomas Basler
parent 8b170e6944
commit 03884eabca
1 changed files with 9 additions and 3 deletions

View File

@ -11,7 +11,7 @@ let valueVideo = 20;
if(localValueVideo){
valueVideo = parseInt(localValueVideo);
}
let videoConstraint: boolean|MediaTrackConstraints = {
let videoConstraint: MediaTrackConstraints = {
width: { min: 640, ideal: 1280, max: 1920 },
height: { min: 400, ideal: 720 },
frameRate: { ideal: valueVideo },
@ -19,6 +19,12 @@ let videoConstraint: boolean|MediaTrackConstraints = {
resizeMode: 'crop-and-scale',
aspectRatio: 1.777777778
};
const audioConstraint: MediaTrackConstraints = {
// TODO: Make these values configurable in the game settings menu and store them in local storage
autoGainControl: false,
echoCancellation: true,
noiseSuppression: false
};
export type UpdatedLocalStreamCallback = (media: MediaStream|null) => void;
export type StartScreenSharingCallback = (media: MediaStream) => void;
@ -41,7 +47,7 @@ export class MediaManager {
webrtcInAudio: HTMLAudioElement;
private webrtcOutAudio: HTMLAudioElement;
constraintsMedia : MediaStreamConstraints = {
audio: true,
audio: audioConstraint,
video: videoConstraint
};
updatedLocalStreamCallBacks : Set<UpdatedLocalStreamCallback> = new Set<UpdatedLocalStreamCallback>();
@ -239,7 +245,7 @@ export class MediaManager {
}
public enableMicrophone() {
this.constraintsMedia.audio = true;
this.constraintsMedia.audio = audioConstraint;
this.getCamera().then((stream) => {
//TODO show error message tooltip upper of camera button