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 memory buffer name extension.
static auto createFromStream(std::unique_ptr<Death::IO::Stream> fileHandle, const 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 -> int
Returns number of bytes per sample.
auto numChannels() const -> int
Returns number of channels.
auto frequency() const -> int
Returns samples frequency.
auto numSamples() const -> unsigned long int
Returns number of samples.
auto duration() const -> float
Returns the duration in seconds.
auto bufferSize() const -> unsigned long int
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, const Death::Containers::StringView path) -> std::unique_ptr<IAudioLoader>

Protected variables

bool hasLoaded_
A flag indicating if the loading process has been successful.
std::unique_ptr<Death::IO::Stream> fileHandle_
Audio file handle.
int bytesPerSample_
Number of bytes per sample.
int numChannels_
Number of channels.
int frequency_
Samples frequency.
unsigned long int numSamples_
Number of samples.
float duration_
Duration in seconds.

Function documentation

static std::unique_ptr<IAudioLoader> nCine::IAudioLoader::createFromFile(const Death::Containers::StringView path)

Returns the proper audio loader according to the memory buffer name extension.

Returns the proper audio loader according to the file extension