mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 09:41:20 -08:00
fix(asr): [PKG-ASR-08] keep captured fallback off the audible route
This commit is contained in:
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)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user