fix(asr): [PKG-ASR-08] keep captured fallback off the audible route

This commit is contained in:
Harvey Zhao committed 2026-09-13 15:40:27 +08:00
1 parent 3e3bed2b93
commit 6d7b9292f8
19 files changed
+5104 -25

No files matched your search

+4 -2
View File
@@ -99,14 +99,16 @@ class AudioGraph {
this.disconnect();
const gain = this.gain = previousGain || context.createGain();
if (!previousGain)
gain.gain.value = 1;
gain.gain.value = this.direct ? 1 : 0;
const recorder = this.recorder = new AudioWorkletNode(context, "recorder-processor");
recorder.port.onmessage = (event) => {
if (!this.closed && this.recorder === recorder)
receive(event.data);
};
source.connect(recorder);
source.connect(gain);
if (this.direct)
source.connect(gain);
else recorder.connect(gain);
gain.connect(context.destination);
}
disconnect() {