@@ -216,6 +216,40 @@ class Howl
216216 {
217217 return null ;
218218 }
219+
220+ /**
221+ * Get/set the panner node's attributes for a sound or group of sounds. This method can optionally take 0, 1 or 2 arguments.
222+ * pannerAttr() -> Returns the group's values.
223+ * pannerAttr(id) -> Returns the sound id's values.
224+ * pannerAttr(o) -> Set's the values of all sounds in this Howl group.
225+ * pannerAttr(o, id) -> Set's the values of passed sound id.
226+ *
227+ * Attributes:
228+ * coneInnerAngle - (360 by default) A parameter for directional audio sources, this is an angle, in degrees,
229+ * inside of which there will be no volume reduction.
230+ * coneOuterAngle - (360 by default) A parameter for directional audio sources, this is an angle, in degrees,
231+ * outside of which the volume will be reduced to a constant value of coneOuterGain.
232+ * coneOuterGain - (0 by default) A parameter for directional audio sources, this is the gain outside of the
233+ * coneOuterAngle. It is a linear value in the range [0, 1].
234+ * distanceModel - ('inverse' by default) Determines algorithm used to reduce volume as audio moves away from
235+ * listener. Can be linear, inverse or `exponential.
236+ * maxDistance - (10000 by default) The maximum distance between source and listener, after which the volume
237+ * will not be reduced any further.
238+ * refDistance - (1 by default) A reference distance for reducing volume as source moves further from the listener.
239+ * This is simply a variable of the distance model and has a different effect depending on which model
240+ * is used and the scale of your coordinates. Generally, volume will be equal to 1 at this distance.
241+ * rolloffFactor - (1 by default) How quickly the volume reduces as source moves from listener. This is simply a
242+ * variable of the distance model and can be in the range of [0, 1] with linear and [0, ∞]
243+ * with inverse and exponential.
244+ * panningModel - ('HRTF' by default) Determines which spatialization algorithm is used to position audio.
245+ * Can be HRTF or equalpower.
246+ *
247+ * @return Returns self or current panner attributes.
248+ */
249+ public function pannerAttr (args : PannerAttr , ? id : Int ): Howl
250+ {
251+ return this ;
252+ }
219253}
220254#else
221255import haxe .Constraints .Function ;
@@ -267,6 +301,7 @@ extern class Howl
267301 @:overload (function (x : Float , y : Float , z : Float ): Howl {})
268302 @:overload (function (x : Float , y : Float , z : Float , id : Int ): Howl {})
269303 public function pos (): Array <Float >;
304+ public function pannerAttr (args : PannerAttr , ? id : Int ): Howl ;
270305}
271306#end
272307
@@ -295,4 +330,16 @@ typedef HowlOptions =
295330 ? onseek : Function ,
296331 ? onfade : Function
297332}
333+
334+ typedef PannerAttr =
335+ {
336+ ? coneInnerAngle : Float ,
337+ ? coneOuterAngle : Float ,
338+ ? coneOuterGain : Float ,
339+ ? distanceModel : String ,
340+ ? maxDistance : Float ,
341+ ? refDistance : Float ,
342+ ? rolloffFactor : Float ,
343+ ? panningModel : String
344+ }
298345#end
0 commit comments