You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/audiodocs/docs/core/audio-node.mdx
+48-2Lines changed: 48 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,52 @@ Based on them we can obtain output's number of channels and mixing strategy.
35
35
|`channelCountMode`|[`ChannelCountMode`](/types/channel-count-mode)| Enumerated value that specifies the method by which channels are mixed between the node's inputs and outputs. | <ReadOnly /> |
36
36
|`channelInterpretation`|[`ChannelInterpretation`](/types/channel-interpretation)| Enumerated value that specifies how input channels are mapped to output channels when number of them is different. | <ReadOnly /> |
lfo.frequency.value=2; //low frequency oscillator with 2Hz
70
+
71
+
// by default oscillator wave values ranges from -1 to 1
72
+
// connecting lfo to gain param will cause the gain param to oscillate at 2Hz and its value will range from 0.5 - 1 to 0.5 + 1
73
+
// you can modulate amplitude by connecting lfo to another gain that would be responsible for this value
74
+
lfo.connect(gainNode.gain)
75
+
76
+
oscillatorNode.connect(gainNode);
77
+
gainNode.connect(audioContext.destination);
78
+
oscillatorNode.start(audioContext.currentTime);
79
+
lfo.start(audioContext.currentTime);
80
+
}
81
+
```
82
+
83
+
38
84
## Methods
39
85
40
86
### `connect`
@@ -43,7 +89,7 @@ The above method lets you connect one of the node's outputs to a destination.
43
89
44
90
| Parameters | Type | Description |
45
91
| :---: | :---: | :---- |
46
-
|`destination`|[`AudioNode`](/core/audio-node)|`AudioNode` to which to connect. |
92
+
|`destination`|[`AudioNode`](/core/audio-node)or [`AudioParam`](/core/audio-param)|`AudioNode` or `AudioParam` to which to connect. |
47
93
48
94
#### Errors:
49
95
@@ -59,7 +105,7 @@ The above method lets you disconnect one or more nodes from the node.
59
105
60
106
| Parameters | Type | Description |
61
107
| :---: | :---: | :---- |
62
-
|`destination` <Optional /> |[`AudioNode`](/core/audio-node)|`AudioNode`to which to connect. |
108
+
|`destination` <Optional /> |[`AudioNode`](/core/audio-node)or [`AudioParam`](/core/audio-param)|`AudioNode`or `AudioParam` from which to disconnect. |
63
109
64
110
If no arguments provided node disconnects from all outgoing connections.
0 commit comments