BiquadFilterNode: thuộc tính detune

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 detune của giao diện BiquadFilterNode là một AudioParam a-rate biểu diễn độ lệch tần số tính theo cent.

Giá trị

Một AudioParam a-rate.

Note: Mặc dù AudioParam được trả về là chỉ đọc, giá trị mà nó biểu diễn thì không phải.

Ví dụ

Ví dụ sau cho thấy cách dùng cơ bản của một AudioContext để tạo một nút bộ lọc Biquad. Để xem ví dụ/thông tin đầy đủ hơn, hãy tham khảo bản minh họa Voice-change-O-matic của chúng tôi (xem các dòng 108–193 trong app.js để biết phần mã liên quan).

js
const audioCtx = new AudioContext();

// Set up the different audio nodes we will use for the app
const analyser = audioCtx.createAnalyser();
const distortion = audioCtx.createWaveShaper();
const gainNode = audioCtx.createGain();
const biquadFilter = audioCtx.createBiquadFilter();
const convolver = audioCtx.createConvolver();

// Connect the nodes together

source = audioCtx.createMediaStreamSource(stream);
source.connect(analyser);
analyser.connect(distortion);
distortion.connect(biquadFilter);
biquadFilter.connect(convolver);
convolver.connect(gainNode);
gainNode.connect(audioCtx.destination);

// Manipulate the Biquad filter

biquadFilter.type = "lowshelf";
biquadFilter.frequency.value = 1000;
biquadFilter.gain.value = 25;
biquadFilter.detune.value = 100;

Thông số kỹ thuật

Thông số kỹ thuật
Web Audio API
# dom-biquadfilternode-detune

Khả năng tương thích trình duyệt

Xem thêm