MediaStreamAudioDestinationNode

Baseline Widely available

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

Giao diện MediaStreamAudioDestinationNode đại diện cho đích âm thanh bao gồm MediaStream WebRTC với một AudioMediaStreamTrack duy nhất, có thể được sử dụng theo cách tương tự như MediaStream thu được từ navigator.mediaDevices.getUserMedia().

Đây là AudioNode hoạt động như đích âm thanh, được tạo bằng phương thức AudioContext.createMediaStreamDestination().

EventTarget AudioNode MediaStreamAudioDestinationNode
Number of inputs 1
Number of outputs 0
Channel count 2
Channel count mode "explicit"
Channel count interpretation "speakers"

Hàm khởi tạo

MediaStreamAudioDestinationNode()

Tạo phiên bản đối tượng MediaStreamAudioDestinationNode mới.

Thuộc tính phiên bản

Kế thừa các thuộc tính từ lớp cha, AudioNode.

MediaStreamAudioDestinationNode.stream

Một MediaStream chứa một MediaStreamTrack duy nhất có kindaudio và cùng số kênh với nút. Bạn có thể sử dụng thuộc tính này để lấy luồng từ đồ thị âm thanh và đưa nó vào cấu trúc khác, chẳng hạn như Media Recorder.

Phương thức phiên bản

Kế thừa các phương thức từ lớp cha, AudioNode.

Ví dụ

Xem AudioContext.createMediaStreamDestination() để xem mã ví dụ tạo MediaStreamAudioDestinationNode và sử dụng nó làm nguồn âm thanh để ghi.

Thông số kỹ thuật

Specification
Web Audio API
# MediaStreamAudioDestinationNode

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

Xem thêm