int playSoundAt(const std::string &name, bool loop, float volume, v3f pos) { maintain(); if(name == "") return 0; SoundBuffer *buf = getFetchBuffer(name); if(!buf){ infostream<<"OpenALSoundManager: \""<<name<<"\" not found." <<std::endl; return -1; } return playSoundRawAt(buf, loop, volume, pos); }
int playSound(const std::string &name, bool loop, float volume, float fade, float pitch) { maintain(); if (name.empty()) return 0; SoundBuffer *buf = getFetchBuffer(name); if(!buf){ infostream<<"OpenALSoundManager: \""<<name<<"\" not found." <<std::endl; return -1; } int handle = -1; if (fade > 0) { handle = playSoundRaw(buf, loop, 0.0f, pitch); fadeSound(handle, fade, volume); } else { handle = playSoundRaw(buf, loop, volume, pitch); } return handle; }