Buffer(const std::string& name) :
Mippleton<Buffer>(name)
{
+ sound = 0;
objects[0] = 0;
objects[1] = 0;
}
if (!sound)
{
- logWarning("audio not found: %s", getName().c_str());
+ logWarning("error while loading sound %s: %s", getName().c_str(), Sound_GetError());
throw Exception(Exception::FILE_NOT_FOUND);
}
unsigned decoded = Sound_DecodeAll(sound);
if (decoded == 0)
{
- logWarning("decoded not bytes from %s", getName().c_str());
- throw Exception(Exception::FILE_NOT_FOUND);
+ logWarning("decoded no bytes from %s", getName().c_str());
+ //throw Exception(Exception::FILE_NOT_FOUND);
+ return;
}
alGenBuffers(2, objects);
void Sound::play()
{
+ if (!impl_->buffer_->sound) return;
+
//alSourceRewind(impl_->source_);
alSourcePlay(impl_->source_);
impl_->playing = true;