File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ class Noise extends Oscillator {
157
157
* White is the default.
158
158
*
159
159
* @method setType
160
- * @param {String } [ type] 'white', 'pink' or 'brown'
160
+ * @param {String } type 'white', 'pink' or 'brown'
161
161
*/
162
162
setType ( type ) {
163
163
switch ( type ) {
@@ -180,9 +180,23 @@ class Noise extends Oscillator {
180
180
}
181
181
}
182
182
183
+ /**
184
+ * Returns current type of noise eg. 'white', 'pink' or 'brown'.
185
+ *
186
+ * @method getType
187
+ * @for p5.Noise
188
+ * @returns {String } type of noise eg. 'white', 'pink' or 'brown'.
189
+ */
183
190
getType ( ) {
184
191
return this . buffer . type ;
185
192
}
193
+
194
+ /**
195
+ * Starts playing the noise.
196
+ *
197
+ * @method start
198
+ * @for p5.Noise
199
+ */
186
200
start ( ) {
187
201
if ( this . started ) {
188
202
this . stop ( ) ;
@@ -196,6 +210,12 @@ class Noise extends Oscillator {
196
210
this . started = true ;
197
211
}
198
212
213
+ /**
214
+ * Stops playing the noise.
215
+ *
216
+ * @method stop
217
+ * @for p5.Noise
218
+ */
199
219
stop ( ) {
200
220
var now = p5sound . audiocontext . currentTime ;
201
221
if ( this . noise ) {
@@ -204,6 +224,12 @@ class Noise extends Oscillator {
204
224
}
205
225
}
206
226
227
+ /**
228
+ * Get rid of the Noise object and free up its resources / memory.
229
+ *
230
+ * @method dispose
231
+ * @for p5.Noise
232
+ */
207
233
dispose ( ) {
208
234
var now = p5sound . audiocontext . currentTime ;
209
235
You can’t perform that action at this time.
0 commit comments