Version:

MiniAudio Playback Component

The MiniAudio Playback component provides the ability to play audio from a sound file at a specific volume globally or relative to an audio listener.

Supported Audio Formats

  • FLAC
  • MP3
  • OGG
  • WAV

MiniAudio Playback Properties

The MiniAudio Playback component has the following properties.

NameDescriptionDefault
Play SoundPlays the current sound in editor.
Stop SoundStops the current sound in editor.
Sound AssetThe path to the audio file that plays when ‘play’ is called.<Empty>
AutoplaySelect this option to play the audio automatically when the entity activates in the Editor or Game.False
VolumeThe linear (not decibel) audio level in the range 0.0 to 10.0.1.0
Auto-followWhether the sound position should move to match the entity’s position.False
LoopWhether the sound should loop or not.False
SpatializationWhether the sound should have a 3D position in the world relative to the current audio listener.False
AttenuationThe attenuation model to use as the audio listener moves further away from the sound, Inverse, Exponential or Linear.Inverse
Min DistanceMinimum distance in meters for attenuation.3.0
Max DistanceMaximum distance in meters for attenuation.3.0

EBus Request Bus Interface

Use the MiniAudioPlaybackRequestBus EBus interface to communicate with the MiniAudio Playback component.

For more information about using the Event Bus (EBus) interface, see Working with the Event Bus (EBus) system.

NameDescriptionParametersReturnScriptable
PlayPlays the sound if set.NoneNoneYes
StopStops the sound if set.NoneNoneYes
SetVolumeSet the volume for the sound.volume - The linear (not decibel) volume level in the range 0.0 to 10.0NoneYes
SetLoopingSets whether the sound should loop or not.loop - True to loop, or False to not loopNoneYes
IsLoopingReturns whether the sound is set to loop or not.NoneTrue if looping, False if not loopingYes
SetSoundAssetSet the sound asset to play.soundAsset - The SoundAssetRef for the sound asset relative to the project or gem asset folder it is in.NoneYes
GetSoundAssetGet the current sound asset.NoneThe current SoundAssetRefYes