46 virtual cAudio::IDataSource* CreateDataSource(
const char* filename,
bool streamingRequested)
50 if (!streamingRequested && source && source->isValid())
53 int length = source->getSize();
54 char* tempbuf = (
char*)CAUDIO_MALLOC(length);
57 source->read(tempbuf, length);
58 cAudio::IDataSource* memSource = CAUDIO_NEW cAudio::cMemorySource(tempbuf, length,
true);
61 if (memSource && memSource->isValid())
86 cAudio::IAudioManager* manager;
89 std::set<SAudioSound*> validSounds;
90 std::set<SAudioInput*> validInput;
95#if CAUDIO_EFX_ENABLED == 1
96 cAudio::IEffect* mEffect;
97 cAudio::IFilter* mFilter;
99 cAudio::FilterTypes mFilterType;
100 float mFilterLowFreqVolume;
101 float mFilterHighFreqVolume;
102 cAudio::EffectTypes mEffectType;
103 std::string mEffectPreset;
112 cAudio::IAudioManager* GetManager();
113 void SetListenerPosition(cAudio::cVector3 pos, cAudio::cVector3 dir);
116 SAudioSound* AddSound(std::string name, std::string path,
bool stream);
117 SAudioSound* AddSound(std::string name,
unsigned int frequency, cAudio::AudioFormats format);
120 void StopAllSounds();
122 void SetMuted(
bool value);
125 void SetMasterVolume(
float volume);
126 float GetMasterVolume();
128 SAudioInput* CreateAudioCapture(
int device = -1,
unsigned int frequency = 22050, cAudio::AudioFormats format = cAudio::EAF_8BIT_MONO);
131#if CAUDIO_EFX_ENABLED == 1
132 bool SetFilter(cAudio::FilterTypes type,
float lowFreqVolume,
float highFreqVolume);
133 bool SetEffect(cAudio::EffectTypes type, std::string preset);
134 bool SetReverbEffectParam(cAudio::sReverbParameters param);
135 bool SetAutowahEffectParam(cAudio::sAutowahParameters param);
136 bool SetChorusEffectParam(cAudio::sChorusParameters param);
137 bool SetCompressorEffectParam(cAudio::sCompressorParameters param);
138 bool SetDistortionEffectParam(cAudio::sDistortionParameters param);
139 bool SetEchoEffectParam(cAudio::sEchoParameters param);
140 bool SetEqualizerEffectParam(cAudio::sEqualizerParameters param);
141 bool SetFlangerEffectParam(cAudio::sFlangerParameters param);
142 bool SetFrequencyShiftEffectParam(cAudio::sFrequencyShiftParameters param);
143 bool SetPitchShifterEffectParam(cAudio::sPitchShifterParameters param);
144 bool SetRingModulatorEffectParam(cAudio::sRingModulatorParameters param);
145 bool SetVocalMorpherEffectParam(cAudio::sVocalMorpherParameters param);
147 void AttachSoundEffect(cAudio::IAudioSource* source);
148 void DettachSoundEffect(cAudio::IAudioSource* source);
149 void AttachSoundFilter(cAudio::IAudioSource* source);
150 void DettachSoundFilter(cAudio::IAudioSource* source);
178#if CAUDIO_EFX_ENABLED == 1
215 SAudioSound(std::string name, std::string path,
bool stream);
216 SAudioSound(std::string name,
unsigned int frequency, cAudio::AudioFormats format);
224 cAudio::IAudioSource* mSound;
229 float mLast3dAttenuation;
233 std::string GetName();
235 bool Play(
bool loop);
236 bool Play3d(
float attenuation,
bool loop);
239 void SetVolume(
float volume);
244 bool FillBuffer(
const char* &data,
const unsigned int &size);
246 bool GetLoopOnResume();
247 void SetLoopOnResume(
bool state);
248 bool GetPlayOnResume();
249 void SetPlayOnResume(
bool playOnResume);
251 float Get3DAttenuation();
253 float GetTotalTime();
254 void SetPitch(
float pitch);
256 void Seek(
float pos,
bool relative);
259 void SetPositionAndDirection(cAudio::cVector3 pos, cAudio::cVector3 dir);
260 cAudio::cVector3 GetPosition();
261 cAudio::cVector3 GetDirection();
263 void SetCone(
float inner,
float outer,
float outvol);
264 float GetInnerCone();
265 float GetOuterCone();
266 float GetOuterConeVolume();
268 void SetRolloffFactor(
float rolloff);
269 float GetRolloffFactor();
271#if CAUDIO_EFX_ENABLED == 1
272 void SetEffectState(
bool state);
273 void SetFilterState(
bool state);
276 virtual void onUpdate();