Classes

Audio/Source

Brief descriptions

Classes

IAudioSource

Provides interface for managing audio playback.

Detailed information

IAudioSource

engine/core/modules/audio/include/nau/audio/audio_source.hpp

class IAudioSource

Provides interface for managing audio playback.

Subclassed by AudioContainer

Public Functions

virtual void play() = 0

Resumes the audio playback.

virtual void stop() = 0

Stops the audio playback.

Note

Currently stop and pause methods are similar. Calling stop does not result in playback rewinding. To rewind the playback use rewind function.

virtual void pause() = 0

Pauses the audio playback.

Note

Currently stop and pause methods are similar.

virtual void seek(std::chrono::milliseconds ms) = 0

Changes the current audio source playback position.

Parameters:

ms[in] Value in milliseconds to change the current playback position to.

virtual void rewind()

Resets the audio source playback to the beginning.

virtual std::chrono::milliseconds position() const = 0

Retrieves the audio source playback position.

Returns:

Audio source playback current in milliseconds.

virtual std::chrono::milliseconds duration() const = 0

Retrieves the audio source duration.

Returns:

Audio source duration in milliseconds.

virtual bool isAtEnd() const = 0

Checks whether the audio source playback has reached its end.

Returns:

true if the playback has reached its end, false otherwise.

virtual bool isPlaying() const = 0

Checks whether the audio source is currently being played.

Returns:

true if the audio source is currently being pplayed, false otherwise.

virtual void setEndCallback(SoundCompletionCallback callback) = 0

Sets a callback to be dispatched when the audio source playback reaches its end.

Parameters:

callback[in] Callback to use.

virtual void playNext(std::shared_ptr<IAudioSource> next)

Sets an audio source to be played after this source playback has reached its end.

Parameters:

next[in] A pointer to the audio source to be played next.