#include <sound.h>
Public Member Functions | |
virtual uint | size () const =0 |
virtual bool | isOpen () const =0 |
virtual void | clearCache ()=0 |
virtual SoundSample * | getSample (int i, uint freq)=0 |
An abstract wrapper around archives of sound samples or dubbing.
|
pure virtual |
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.
Implemented in Draci::ZipSoundArchive, and Draci::LegacySoundArchive.
|
pure virtual |
Checks whether there is an archive opened. Should be called before reading from the archive to check whether opening of the archive has succeeded.
Implemented in Draci::ZipSoundArchive, and Draci::LegacySoundArchive.
|
pure virtual |
Removes cached samples from memory.
Implemented in Draci::ZipSoundArchive, and Draci::LegacySoundArchive.
|
pure virtual |
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).
Implemented in Draci::ZipSoundArchive, and Draci::LegacySoundArchive.