class IAudioSourceImplementation

Low-level interface for an audio source.

Should be implemented by the audio plugin.

Public

Methods

~IAudioSourceImplementation

virtual ~IAudioSourceImplementation() = default

SetClip

virtual void SetClip(const HAudioClip &clip) = 0

Audio clip to play.

SetVelocity

virtual void SetVelocity(const Vector3 &velocity) = 0

Velocity of the source.

Determines pitch in relation to AudioListener's position. Only relevant for spatial (3D) sources.

SetTransform

virtual void SetTransform(const Transform &transform) = 0

Sets the position and orientation of the audio source.

SetVolume

virtual void SetVolume(float volume) = 0

Volume of the audio played from this source, in [0, 1] range.

SetPitch

virtual void SetPitch(float pitch) = 0

Determines the pitch of the played audio. 1 is the default.

SetIsLooping

virtual void SetIsLooping(bool loop) = 0

Determines whether the audio clip should loop when it finishes playing.

SetPriority

virtual void SetPriority(i32 priority) = 0

Determines the priority of the audio source.

If more audio sources are playing than supported by the hardware, some might get disabled. By setting a higher priority the audio source is guaranteed to be disabled after sources with lower priority.

SetMinDistance

virtual void SetMinDistance(float distance) = 0

Minimum distance at which audio attenuation starts.

When the listener is closer to the source than this value, audio is heard at full volume. Once farther away the audio starts attenuating.

SetAttenuation

virtual void SetAttenuation(float attenuation) = 0

Attenuation that controls how quickly does audio volume drop off as the listener moves further from the source.

Play

virtual void Play() = 0

Starts playing the currently assigned audio clip.

Pause

virtual void Pause() = 0

Pauses the audio playback.

Stop

virtual void Stop() = 0

Stops audio playback, rewinding it to the start.

SetTime

virtual void SetTime(float time) = 0

Determines the current time of playback.

If playback hasn't yet started, it specifies the time at which playback will start at. The time is in seconds, in range [0, clipLength].

GetTime

virtual float GetTime() const = 0

GetState

virtual AudioSourceState GetState() const = 0

Returns the current state of the audio playback (playing/paused/stopped).