AudioListener: phương thức setPosition()
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Phương thức setPosition() của giao diện AudioListener xác định vị trí của listener.
Ba tham số x, y và z không có đơn vị và mô tả vị trí của listener trong không gian 3D theo hệ tọa độ Descartes tay phải. Các đối tượng PannerNode dùng vị trí này tương đối với từng nguồn âm thanh để thực hiện âm thanh không gian.
Giá trị mặc định của vector vị trí là (0, 0, 0).
Cú pháp
setPosition(x, y, z)
Tham số
Giá trị trả về
Không có (undefined).
Ví dụ
Xem BaseAudioContext.createPanner() để có mã ví dụ.
Thông số kỹ thuật
| Specification |
|---|
| Web Audio API> # dom-audiolistener-setposition> |