Classes

Audio

Brief descriptions

Detailed information

IAudioEngine

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

class IAudioEngine

Public Types

enum Backend

Enumerates supported audio engine backends.

Values:

enumerator Miniaudio

Public Functions

virtual ~IAudioEngine() = default

Destructor.

virtual void initialize() = 0

Initializes the audio engine.

virtual void deinitialize() = 0

Deinitializes the audio engine.

virtual void update() = 0
virtual AudioAssetPtr loadSound(const eastl::string &path) = 0

Creates an audio asset from the file.

Parameters:

path[in] Path to the audio file.

Returns:

A pointer to the created asset.

virtual AudioAssetPtr loadStream(const eastl::string &path) = 0

Creates an audio asset from the streamed audio file.

Note

When a large audio file (e.g. a music track) is to be loaded, it is more efficent to stream it then to boldly load the entire file. When an audio file is streamed, it is loaded in pieces of 2 seconds length. If the audio is short, use standard loadSound function.

Parameters:

path[in] Path to the audio file to stream.

Returns:

A pointer to the created asset.

virtual AudioAssetContainerPtr createContainer(const eastl::string &name)
virtual AudioAssetList audioAssets() = 0
virtual AudioAssetContainerList containerAssets()
virtual AudioAssetList assets()

Public Static Functions

static std::unique_ptr<IAudioEngine> create(Backend backend)

Creates the audio engine and initializes the backend.

Warning

Currently only Miniaudio is supported.

Parameters:

Identifier[in] of the backend to initialize.

Private Members

AudioAssetContainerList m_containers

AudioService

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

class AudioService : public IServiceInitialization, public IServiceShutdown

Public Functions

async::Task initService() override
async::Task shutdownService() override
IAudioEngine &engine()

Private Members

AudioEnginePtr m_engine

Subscribable

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

template<typename Callback>
class Subscribable

Public Functions

virtual void subscribe(void *subscriber, Callback callback)
virtual void unsubscribe(void *subscriber)

Protected Functions

virtual void notifyAll()

Private Members

eastl::unordered_map<uint64_t, Callback> m_watchers