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

@@ -100,14 +100,16 @@ export 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: MessageEvent<Float32Array>) => {
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)
}