Skip to content

AudioComponent

Michele edited this page Oct 8, 2019 · 2 revisions

Description of the Audio Component

The AudioComponent is a component that load and play an audio. It contains all the useful methods to play() or stop() a track whenever you want. You can also set the pitch/gain of the track and also set if the track must loop.

It's divided in:

  • AudioComponent2D: a 2D AudioComponent play an audio without spatializing it into the 3D space. For example a background music, it must not change if the player move.

  • AudioComponent3D: a 3D AudioComponent allow the user to also set the Component location, as the audio is spatialized into the 3D space. For example a gunshot or an explosion, it's way different if is on the left or on the right of the player.