#include <sound.h>
Public Member Functions | |
LegacySoundArchive (const char *path, uint defaultFreq) | |
void | openArchive (const char *path) |
void | closeArchive () |
uint | size () const override |
bool | isOpen () const override |
void | clearCache () override |
SoundSample * | getSample (int i, uint freq) override |
Reads CD.SAM (with dubbing) and CD2.SAM (with sound samples) from the original game. Caches all read samples in a thread-safe manner.
|
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.