AudioDestinationNode.maxChannelCount - Web APIs 编辑
The maxchannelCount
property of the AudioDestinationNode
interface is an unsigned long
defining the maximum amount of channels that the physical device can handle.
The AudioNode.channelCount
property can be set between 0 and this value (both included). If maxChannelCount
is 0
, like in OfflineAudioContext
, the channel count cannot be changed.
Syntax
var audioCtx = new AudioContext();
var myDestination = audioCtx.destination;
myDestination.maxChannelCount = 2;
Value
An unsigned long
.
Example
The following would set up a simple audio graph, featuring an AudioDestinationNode
with maxChannelCount
of 2:
var audioCtx = new AudioContext();
var source = audioCtx.createMediaElementSource(myMediaElement);
source.connect(gainNode);
audioCtx.destination.maxChannelCount = 2;
gainNode.connect(audioCtx.destination);
To see a more complete implementation, check out one of our MDN Web Audio examples, such as Voice-change-o-matic or Violent Theremin.
Specifications
Specification | Status | Comment |
---|---|---|
Web Audio API The definition of 'maxChannelCount' in that specification. | Working Draft |
Browser compatibility
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论