X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FSound.cc;h=4275ea4485900c67e147aeb04165b5f6c2496b30;hp=4c60e328085f60d7d282c2e70144079c49c5dbc2;hb=e495074443d9fd7bc16137084cf9de3d031b75c4;hpb=c9e20ac06383b20ceb5404c9237e319c2e90d157 diff --git a/src/Moof/Sound.cc b/src/Moof/Sound.cc index 4c60e32..4275ea4 100644 --- a/src/Moof/Sound.cc +++ b/src/Moof/Sound.cc @@ -35,6 +35,7 @@ #include #include +#include "Engine.hh" #include "Exception.hh" #include "Library.hh" #include "Log.hh" @@ -98,15 +99,12 @@ public: { logWarning("error while loading sound %s", getName().c_str()); - throw Exception(ErrorCode::UNKNOWN_AUDIO_FORMAT); + throw Exception(ErrorCode::UNKNOWN_AUDIO_FORMAT, getName()); } vorbis_info* vorbisInfo = ov_info(&mOggStream, -1); mFormat = getAudioFormat(vorbisInfo); mFreq = vorbisInfo->rate; - - logDebug(" channels: %d", vorbisInfo->channels); - logDebug(" frequency: %d", vorbisInfo->rate); } @@ -137,7 +135,6 @@ public: if (size == 0) { logWarning("decoded no bytes from %s", getName().c_str()); - //throw Exception("file_not_found"); return; } @@ -209,6 +206,9 @@ public: void init() { + // make sure the engine is initialized + Engine::getInstance(); + ALfloat zero[] = {0.0f, 0.0f, 0.0f}; alGenSources(1, &mSource);