Jazz2::Resources::GenericSoundResource struct

Shared sound resource.

Loaded, cached audio buffer for a single sound file, decoded on construction from a stream (the file name is used to detect the format), together with its resource flags. Owned by ContentResolver and referenced by the SoundResource entries that group the buffers belonging to one named metadata sound. Where the audio device plays sound in a format of its own (NCINE_HAS_NATIVE_AUDIO), it is created from the path of such a file instead, and nothing is decoded.

Constructors, destructors, conversion operators

GenericSoundResource(std::unique_ptr<Stream> stream, StringView filename) noexcept
Creates a new instance from a stream.
GenericSoundResource(StringView path) explicit noexcept
Creates a new instance from a file the audio device may play natively.

Public variables

AudioBuffer Buffer
Audio buffer.
GenericSoundResourceFlags Flags
Resource flags.

Function documentation

Jazz2::Resources::GenericSoundResource::GenericSoundResource(std::unique_ptr<Stream> stream, StringView filename) noexcept

Creates a new instance from a stream.

Parameters
stream Stream containing the sound data
filename File name used to detect the audio format

Jazz2::Resources::GenericSoundResource::GenericSoundResource(StringView path) explicit noexcept

Creates a new instance from a file the audio device may play natively.

Parameters
path Full path to the file