audio.panner
panner(sound_name: string, attribute: object, id: number) → {Object}
get or set the panner node's attributes for a sound or group of sounds. See https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialization_basics#creating_a_panner_node
me.audio.panner("cling", {
panningModel: 'HRTF',
refDistance: 0.8,
rolloffFactor: 2.5,
distanceModel: 'exponential'
});
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
sound_name | string |
audio clip name - case sensitive |
||
attribute | object |
<optional> |
the panner attributes to set |
|
settings.coneInnerAngle | string |
<optional> |
360 |
A parameter for directional audio sources, this is an angle, in degrees, inside of which there will be no volume reduction. |
settings.coneOuterAngle | string |
<optional> |
360 |
A parameter for directional audio sources, this is an angle, in degrees, outside of which the volume will be reduced to a constant value of |
settings.coneOuterGain | string |
<optional> |
0 |
A parameter for directional audio sources, this is the gain outside of the |
settings.distanceModel | string |
<optional> |
"inverse" |
Determines algorithm used to reduce volume as audio moves away from listener. Can be |
settings.maxDistance | string |
<optional> |
10000 |
The maximum distance between source and listener, after which the volume will not be reduced any further. |
settings.refDistance | string |
<optional> |
1 |
A reference distance for reducing volume as source moves further from the listener. This is simply a variable of the distance model and has a different effect depending on which model is used and the scale of your coordinates. Generally, volume will be equal to 1 at this distance. |
settings.rolloffFactor | string |
<optional> |
1 |
How quickly the volume reduces as source moves from listener. This is simply a variable of the distance model and can be in the range of |
settings.panningModel | string |
<optional> |
"HRTF" |
Determines which spatialization algorithm is used to position audio. Can be |
id | number |
<optional> |
the sound instance ID. If none is passed, all sounds in group will be changed. |
Type | Description |
---|---|
Object |
current panner attributes. |