AudioParam: phương thức cancelScheduledValues()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Phương thức cancelScheduledValues() của giao diện AudioParam hủy mọi thay đổi trong tương lai đã được lên lịch cho AudioParam.
Cú pháp
js
cancelScheduledValues(startTime)
Tham số
startTime-
Một số thực kép biểu diễn thời điểm (tính bằng giây) kể từ sau khi
AudioContextđược tạo lần đầu, sau đó mọi thay đổi đã lên lịch sẽ bị hủy.
Giá trị trả về
Tham chiếu đến đối tượng AudioParam này. Trong một số cách triển khai cũ hơn, phương thức này trả về undefined.
Ví dụ
js
const gainNode = audioCtx.createGain();
gainNode.gain.setValueCurveAtTime(waveArray, audioCtx.currentTime, 2); // 'gain' là AudioParam
gainNode.gain.cancelScheduledValues(audioCtx.currentTime);
Thông số kỹ thuật
| Specification |
|---|
| Web Audio API> # dom-audioparam-cancelscheduledvalues> |