Improved the echo testing

This commit is contained in:
WolverinDEV 2020-09-16 21:12:28 +02:00
parent b1cdbf93d1
commit 94b6c5aaa5

View file

@ -787,7 +787,7 @@ export class ConnectionHandler {
/* update the recorder state */ /* update the recorder state */
const currentInput = voiceConnection.voiceRecorder()?.input; const currentInput = voiceConnection.voiceRecorder()?.input;
if(currentInput) { if(currentInput) {
if(shouldRecord) { if(shouldRecord || this.echoTestRunning) {
if(this.getInputHardwareState() !== InputHardwareState.START_FAILED) { if(this.getInputHardwareState() !== InputHardwareState.START_FAILED) {
this.startVoiceRecorder(Date.now() - this._last_record_error_popup > 10 * 1000).then(() => { this.startVoiceRecorder(Date.now() - this._last_record_error_popup > 10 * 1000).then(() => {
this.event_registry.fire("notify_state_updated", { state: "microphone" }); this.event_registry.fire("notify_state_updated", { state: "microphone" });
@ -1158,10 +1158,7 @@ export class ConnectionHandler {
async startEchoTest() : Promise<void> { async startEchoTest() : Promise<void> {
await this.serverConnection.getVoiceConnection().startWhisper({ target: "echo" }); await this.serverConnection.getVoiceConnection().startWhisper({ target: "echo" });
/* TODO: store and later restore microphone status! */
this.client_status.input_muted = false;
this.update_voice_status(); this.update_voice_status();
try { try {
this.echoTestRunning = true; this.echoTestRunning = true;
const startResult = await this.startVoiceRecorder(false); const startResult = await this.startVoiceRecorder(false);