25#include "common/str.h"
26#include "common/file.h"
27#include "common/list.h"
28#include "audio/mixer.h"
32class SeekableReadStream;
37enum SoundFormat { RAW, RAW80, MP3, OGG, FLAC };
52 SoundSample() : _offset(0), _length(0), _frequency(0), _format(RAW), _data(NULL), _stream(NULL) { }
76 virtual uint
size()
const = 0;
106 _path(NULL), _samples(NULL), _sampleCount(0), _defaultFreq(defaultFreq), _opened(
false), _f(NULL) {
111 void openArchive(
const char *path);
114 uint
size()
const override {
return _sampleCount; }
115 bool isOpen()
const override {
return _opened; }
136 ZipSoundArchive() : _archive(NULL), _path(NULL), _extension(NULL), _format(RAW), _sampleCount(0), _defaultFreq(0), _cache() { }
139 void openArchive(
const char *path,
const char *extension, SoundFormat format,
int raw_frequency = 0);
142 uint
size()
const override {
return _sampleCount; }
143 bool isOpen()
const override {
return _archive != NULL; }
151 const char *_extension;
167#define SOUND_HANDLES 10
188 uint playSound(
const SoundSample *buffer,
int volume,
bool loop);
192 bool isMutedSound()
const {
return _muteSound; }
198 bool isMutedVoice()
const {
return _muteVoice; }
200 void stopAll() { stopVoice(); stopSound(); }
204 bool showSubtitles()
const {
return _showSubtitles; }
205 int talkSpeed()
const {
return _talkSpeed; }
210 sndHandleType handleType,
bool loop);
Definition: archive.h:141
bool isOpen() const override
Definition: sound.h:115
void clearCache() override
uint size() const override
Definition: sound.h:114
SoundSample * getSample(int i, uint freq) override
virtual SoundSample * getSample(int i, uint freq)=0
virtual void clearCache()=0
virtual uint size() const =0
virtual bool isOpen() const =0
void clearCache() override
uint size() const override
Definition: sound.h:142
bool isOpen() const override
Definition: sound.h:143
SoundSample * getSample(int i, uint freq) override
Definition: algorithm.h:29
Definition: animation.h:30