BaseAudioContext: thuộc tính destination
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.
Thuộc tính destination của BaseAudioContext
trả về một AudioDestinationNode biểu diễn đích cuối cùng
của mọi âm thanh trong ngữ cảnh. Nó thường đại diện cho một thiết bị kết xuất âm thanh thực tế như loa của thiết bị.
Giá trị
Một AudioDestinationNode.
Ví dụ
Note: Để xem ví dụ/thông tin ứng dụng đầy đủ hơn, hãy xem bản demo Voice-change-O-matic của chúng tôi (xem app.js dòng 108-193 để biết phần mã liên quan).
js
const audioCtx = new AudioContext();
// Các trình duyệt webkit/blink cũ yêu cầu tiền tố
const oscillatorNode = audioCtx.createOscillator();
const gainNode = audioCtx.createGain();
oscillatorNode.connect(gainNode);
gainNode.connect(audioCtx.destination);
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| Web Audio API> # dom-baseaudiocontext-destination> |