Audio Shape#

Back To Audio

Audio shapes model the area of a spatial audio's range. For example in an open field sound follows a circular shape outward from the point of origin. In a closed room, sound would take on a more rectangular shape.

Audio shapes specify the minimum and maximum attenuation distances with respect to a shape. This is illustrated in the following images:

Box Audio Shape Box Audio Shape
Circle Audio Shape Circle Audio Shape
Capsule Audio Shape Capsule Audio Shape


In GameKit, audio shapes are represented by the abstract AudioShape class. You can extend this and implement the getDistance method to define custom audio shapes.

The getDistance method is called with the following arguments and should return the relative distance between the source and listener based on the shape:

  1. Position of the audio source
  2. Position of the audio listener

GameKit ships with one (1) audio shape implementation which is CircuelAudioShape class.

Public Methods#

Method Description
getDistance Returns the relative distance between the source and listener based on the shape