-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
49 lines (33 loc) · 1.16 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
title: "AudioParam: cancelScheduledValues() method"
short-title: cancelScheduledValues()
slug: Web/API/AudioParam/cancelScheduledValues
page-type: web-api-instance-method
browser-compat: api.AudioParam.cancelScheduledValues
---
{{ APIRef("Web Audio API") }}
The `cancelScheduledValues()` method of the {{ domxref("AudioParam") }}
Interface cancels all scheduled future changes to the `AudioParam`.
## Syntax
```js-nolint
cancelScheduledValues(startTime)
```
### Parameters
- `startTime`
- : A double representing the time (in seconds) after the {{ domxref("AudioContext") }}
was first created after which all scheduled changes will be cancelled.
### Return value
A reference to this `AudioParam` object. In some older implementations this
method returns {{jsxref('undefined')}}.
## Examples
```js
const gainNode = audioCtx.createGain();
gainNode.gain.setValueCurveAtTime(waveArray, audioCtx.currentTime, 2); //'gain' is the AudioParam
gainNode.gain.cancelScheduledValues(audioCtx.currentTime);
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [Using the Web Audio API](/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API)