We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2591c10 + 1012647 commit 0de645fCopy full SHA for 0de645f
test/tests/p5.Gain.js
@@ -36,6 +36,24 @@ describe('p5.Gain', function () {
36
gain.connect(filter);
37
gain.connect(filter.input);
38
});
39
+ it('can set the output level of gain node', (done) => {
40
+ let osc = new p5.Oscillator('sine');
41
+ let mainGainNode = new p5.Gain();
42
+ let amplitude = new p5.Amplitude();
43
+
44
+ osc.amp(1);
45
+ osc.start();
46
+ osc.disconnect();
47
48
+ mainGainNode.setInput(osc);
49
+ amplitude.setInput(mainGainNode);
50
51
+ mainGainNode.amp(0.5);
52
+ setTimeout(function () {
53
+ expect(amplitude.getLevel()).to.be.closeTo(0.25, 0.125);
54
+ done();
55
+ }, 100);
56
+ });
57
it('can disconnect', function () {
58
let filter = new p5.Filter();
59
0 commit comments