Merge pull request #688 from tabascoeye/patch-2

disable automatic gain control on microphone
This commit is contained in:
Kharhamel 2021-04-13 18:20:56 +02:00 committed by GitHub
commit 3874b2bc2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -14,6 +14,12 @@ let videoConstraint: boolean|MediaTrackConstraints = {
resizeMode: 'crop-and-scale',
aspectRatio: 1.777777778
};
const audioConstraint: boolean|MediaTrackConstraints = {
//TODO: make these values configurable in the game settings menu and store them in localstorage
autoGainControl: false,
echoCancellation: true,
noiseSuppression: false
};
export type UpdatedLocalStreamCallback = (media: MediaStream|null) => void;
export type StartScreenSharingCallback = (media: MediaStream) => void;
@ -36,7 +42,7 @@ export class MediaManager {
webrtcInAudio: HTMLAudioElement;
private webrtcOutAudio: HTMLAudioElement;
constraintsMedia : MediaStreamConstraints = {
audio: true,
audio: audioConstraint,
video: videoConstraint
};
updatedLocalStreamCallBacks : Set<UpdatedLocalStreamCallback> = new Set<UpdatedLocalStreamCallback>();
@ -234,7 +240,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