1 | import { Gain } from "../core/context/Gain.js";
|
2 | import { connect, disconnect, } from "../core/context/ToneAudioNode.js";
|
3 | import { optionsFromArguments } from "../core/util/Defaults.js";
|
4 | import { SignalOperator } from "./SignalOperator.js";
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export class Zero extends SignalOperator {
|
12 | constructor() {
|
13 | super(optionsFromArguments(Zero.getDefaults(), arguments));
|
14 | this.name = "Zero";
|
15 | |
16 |
|
17 |
|
18 | this._gain = new Gain({ context: this.context });
|
19 | |
20 |
|
21 |
|
22 | this.output = this._gain;
|
23 | |
24 |
|
25 |
|
26 | this.input = undefined;
|
27 | connect(this.context.getConstant(0), this._gain);
|
28 | }
|
29 | |
30 |
|
31 |
|
32 | dispose() {
|
33 | super.dispose();
|
34 | disconnect(this.context.getConstant(0), this._gain);
|
35 | return this;
|
36 | }
|
37 | }
|
38 |
|
\ | No newline at end of file |