AudioParam: thuộc tính defaultValue

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Thuộc tính chỉ đọc defaultValue của giao diện AudioParam biểu diễn giá trị ban đầu của các thuộc tính như được định nghĩa bởi AudioNode cụ thể đã tạo ra AudioParam.

Giá trị

Một Number dấu chấm động.

Ví dụ

js
const audioCtx = new AudioContext();
const gainNode = audioCtx.createGain();
const defaultVal = gainNode.gain.defaultValue;
console.log(defaultVal); // 1
console.log(defaultVal === gainNode.gain.value); // true

Thông số kỹ thuật

Specification
Web Audio API
# dom-audioparam-defaultvalue

Tương thích trình duyệt

Xem thêm