32 #include "audio/soundclip.h"
34 #include "util/log/logger.h"
35 #include "util/base/exception.h"
37 #include "ogg_loader.h"
38 #include "sounddecoder_ogg.h"
41 static Logger _log(LM_NATIVE_LOADERS);
43 IResource* OggLoader::loadResource(
const ResourceLocation& location) {
44 std::string filename = location.getFilename();
47 if(filename.find(
".ogg", filename.size() - 4) != std::string::npos) {
48 RawData* rdptr = m_vfs->open(location.getFilename());
49 ptr =
new SoundClip(
new SoundDecoderOgg(rdptr));
50 ptr->setResourceLocation(location);
52 FL_WARN(_log, LMsg() <<
"No audio-decoder available for file \"" << filename <<
"\"!");
53 throw InvalidFormat(
"Error: Ogg loader can't load files without ogg extension");