PannerNode()
constructor of the
Web 音频 API
creates a new
PannerNode
对象实例。
var myPanner = new PannerNode(context, options);
Inherits parameters from the
AudioNodeOptions
dictionary
.
BaseAudioContext
representing the audio context you want the node to be associated with.
PannerOptions
dictionary object defining the properties you want the
PannerNode
to have (It also inherits the options defined in the
AudioNodeOptions
dictionary.):
panningModel
:
PannerNode.panningModel
you want the
PannerNode
to have (the default is
equalpower
)。
distanceModel
:
PannerNode.distanceModel
you want the
PannerNode
to have (the default is
inverse
)。
positionX
:
PannerNode.positionX
you want the
PannerNode
to have (the default is
0
)。
positionY
:
PannerNode.positionY
you want the
PannerNode
to have (the default is
0
)。
positionZ
:
PannerNode.positionZ
you want the
PannerNode
to have (the default is
0
)。
orientationX
:
PannerNode.orientationX
you want the
PannerNode
to have (the default is
1
)。
orientationY
:
PannerNode.orientationY
you want the
PannerNode
to have (the default is
0
)。
orientationZ
:
PannerNode.orientationZ
you want the
PannerNode
to have (the default is
0
)。
refDistance
:
PannerNode.refDistance
you want the
PannerNode
to have. The default is
1
, and negative values are not allowed.
maxDistance
:
PannerNode.maxDistance
you want the
PannerNode
to have. The default is
10000
, and non-positive values are not allowed.
rollOffFactor
:
PannerNode.rollOffFactor
you want the
PannerNode
to have. The default is
1
, and negative values are not allowed.
coneInnerAngle
:
PannerNode.coneInnerAngle
you want the
PannerNode
to have (the default is
360
)。
coneOuterAngle
:
PannerNode.coneOuterAngle
you want the
PannerNode
to have (the default is
360
)。
coneOuterGain
:
PannerNode.coneOuterGain
you want the
PannerNode
to have. The default is
0
, and its value can be in the range 0–1.
新的
PannerNode
对象实例。
RangeError
refDistance
,
maxDistance
,或
rolloffFactor
properties have been given a value that is outside the accepted range.
InvalidStateError
coneOuterGain
property has been given a value outside the accepted range (0–1).
var ctx = new AudioContext();
var options = {
positionX : 1,
maxDistance: 5000
}
var myPanner = new PannerNode(ctx, options);
| 规范 | 状态 | 注释 |
|---|---|---|
|
Web 音频 API
The definition of 'PannerNode()' in that specification. |
工作草案 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
PannerNode()
构造函数
|
Chrome
55
|
Edge ≤79 | Firefox 53 | IE No | Opera 42 | Safari ? |
WebView Android
55
|
Chrome Android
55
|
Firefox Android 53 | Opera Android 42 | Safari iOS ? |
Samsung Internet Android
6.0
|
完整支持
不支持
兼容性未知
见实现注意事项。
PannerNode
PannerNode()
AnalyserNode
AudioBuffer
AudioBufferSourceNode
AudioContext
AudioContextOptions
AudioDestinationNode
AudioListener
AudioNode
AudioNodeOptions
AudioParam
AudioProcessingEvent
AudioScheduledSourceNode
AudioWorklet
AudioWorkletGlobalScope
AudioWorkletNode
AudioWorkletProcessor
BaseAudioContext
BiquadFilterNode
ChannelMergerNode
ChannelSplitterNode
ConstantSourceNode
ConvolverNode
DelayNode
DynamicsCompressorNode
GainNode
IIRFilterNode
MediaElementAudioSourceNode
MediaStreamAudioDestinationNode
MediaStreamAudioSourceNode
OfflineAudioCompletionEvent
OfflineAudioContext
OscillatorNode
PeriodicWave
StereoPannerNode
WaveShaperNode