#include <sound.h>
Public Member Functions | |
void | openArchive (const char *path, const char *extension, SoundFormat format, int raw_frequency=0) |
void | closeArchive () |
uint | size () const override |
bool | isOpen () const override |
void | clearCache () override |
SoundSample * | getSample (int i, uint freq) override |
Reads ZIP archives with uncompressed files containing lossy-compressed samples in arbitrary format. Doesn't do any real caching and is thread-safe.
|
inlineoverridevirtual |
Returns the number of sound samples in the archive. Zero means that a fake empty archive has been opened and the caller may consider opening a different one, for example with compressed music.
Implements Draci::SoundArchive.
|
inlineoverridevirtual |
Checks whether there is an archive opened. Should be called before reading from the archive to check whether opening of the archive has succeeded.
Implements Draci::SoundArchive.
|
overridevirtual |
Removes cached samples from memory.
Implements Draci::SoundArchive.
|
overridevirtual |
Caches a given sample into memory and returns a pointer into it. We own the returned pointer, but the user may call .close() on it, which deallocates the memory of the actual sample data. If freq is nonzero, then the sample is played at a different frequency (only works for uncompressed samples).
Implements Draci::SoundArchive.