AudioContext.listener
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.
AudioContext
接口的 listener
属性返回一个 AudioListener
对象,可以用来实现 3D 音频空间化。
值
AudioListener
对象。
示例
备注: 如果需要完整的音频空间化例子,可以查看 panner-node 演示。
js
const audioCtx = new AudioContext();
// 旧式的 webkit/blink 浏览器需要一个前缀
// …
const myListener = audioCtx.listener;
规范
Specification |
---|
Web Audio API # dom-baseaudiocontext-listener |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
listener |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.