]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/readwav.cxx
Reset: allow re-init of Nasal Ghosts.
[simgear.git] / simgear / sound / readwav.cxx
index 3afd61b3c1003db4fabf4066c12ed933e817759b..d23ed8cf7037becbbcc9bde34b38d8553db95cc4 100644 (file)
@@ -284,13 +284,14 @@ ALvoid* loadWAVFromFile(const SGPath& path, ALenum& format, ALsizei& size, ALflo
 
 ALuint createBufferFromFile(const SGPath& path)
 {
+  ALuint buffer = -1;
+#ifdef ENABLE_SOUND
   ALenum format;
   ALsizei size;
   ALfloat sampleFrequency;
   ALvoid* data = loadWAVFromFile(path, format, size, sampleFrequency);
   assert(data);
   
-  ALuint buffer;
   alGenBuffers(1, &buffer);
   if (alGetError() != AL_NO_ERROR) {
     free(data);
@@ -303,7 +304,7 @@ ALuint createBufferFromFile(const SGPath& path)
     free(data);
     throw sg_io_exception("OpenAL setting buffer data failed", sg_location(path.str()));
   }
-    
+#endif 
   return buffer;
 }