nCine::IAudioLoader class

Audio loader interface.

Derived classes

class AudioLoaderMpt
Module audio loader using libopenmpt library.
class AudioLoaderOgg
Ogg Vorbis audio loader using libvorbis library.
class AudioLoaderWav
WAVE audio loader.

Public static functions

static auto createFromFile(const Death::Containers::StringView path) -> std::unique_ptr<IAudioLoader>
Returns the proper audio loader according to the file extension.
static auto createFromStream(std::unique_ptr<Death::IO::Stream> fileHandle, Death::Containers::StringView path) -> std::unique_ptr<IAudioLoader>

Constructors, destructors, conversion operators

~IAudioLoader() virtual
IAudioLoader(std::unique_ptr<Death::IO::Stream> fileHandle) protected explicit

Public functions

auto hasLoaded() const -> bool
Returns true if the audio has been correctly loaded.
auto bytesPerSample() const -> std::int32_t
Returns number of bytes per sample.
auto numChannels() const -> std::int32_t
Returns number of channels.
auto frequency() const -> std::int32_t
Returns samples frequency.
auto numSamples() const -> std::int32_t
Returns number of samples.
auto duration() const -> float
Returns the duration in seconds.
auto bufferSize() const -> std::int32_t
Returns the decoded buffer size in bytes.
auto createReader() -> std::unique_ptr<IAudioReader> pure virtual
Returns the proper audio reader according to the loader instance.

Protected static functions

static auto createLoader(std::unique_ptr<Death::IO::Stream> fileHandle, Death::Containers::StringView path) -> std::unique_ptr<IAudioLoader>