Skip to content

Commit

Permalink
add gain if firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
xqdoo00o committed Apr 16, 2024
1 parent 275a9a4 commit a345f8c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4104,7 +4104,7 @@
};
if (isFirefox) { // tested firefox need volume gain
this.gain = this.context.createGain();
this.gain.gain.value = 4;
this.gain.gain.value = 3;
this.audioInput.connect(this.gain);
this.gain.connect(this.recorder);
} else {
Expand Down Expand Up @@ -4142,7 +4142,14 @@
const inputFrame = event.inputBuffer.getChannelData(0);
if (inputFrame && this.ready) this.pushWSFrame(new Uint8Array(this.encoder.encode(inputFrame)));
};
this.audioInput.connect(this.recorder);
if (isFirefox) { // tested firefox need volume gain
this.gain = this.context.createGain();
this.gain.gain.value = 3;
this.audioInput.connect(this.gain);
this.gain.connect(this.recorder);
} else {
this.audioInput.connect(this.recorder);
}
this.recorder.connect(this.context.destination);
res();
}
Expand Down

0 comments on commit a345f8c

Please sign in to comment.