30 lines
567 B
TypeScript
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()
|
|
}
|
|
} |