Files
bruitiste/src/domain/audio/effects/PassThroughEffect.ts
2025-09-30 16:56:14 +02:00

30 lines
567 B
TypeScript

import type { Effect } from './Effect.interface'
export class PassThroughEffect implements Effect {
readonly id: string
private node: GainNode
constructor(audioContext: AudioContext, id: string) {
this.id = id
this.node = audioContext.createGain()
this.node.gain.value = 1
}
getInputNode(): AudioNode {
return this.node
}
getOutputNode(): AudioNode {
return this.node
}
setBypass(_bypass: boolean): void {
}
updateParams(_values: Record<string, number>): void {
}
dispose(): void {
this.node.disconnect()
}
}