Browse Source

Use OpenAL's direct channel features, should improve audio quality

Boolsheet 13 years ago
parent
commit
ee1b679639
2 changed files with 7 additions and 0 deletions
  1. 6 0
      src/modules/audio/openal/Pool.cpp
  2. 1 0
      src/modules/audio/openal/Pool.h

+ 6 - 0
src/modules/audio/openal/Pool.cpp

@@ -41,7 +41,13 @@ namespace openal
 
 		// Make all sources available initially.
 		for (int i = 0; i < NUM_SOURCES; i++)
+		{
+#ifdef AL_DIRECT_CHANNELS_SOFT
+			// Bypassing virtualization of speakers for multi-channel sources in OpenAL Soft.
+			alSourcei(sources[i], AL_DIRECT_CHANNELS_SOFT, AL_TRUE);
+#endif
 			available.push(sources[i]);
+		}
 	}
 
 	Pool::~Pool()

+ 1 - 0
src/modules/audio/openal/Pool.h

@@ -39,6 +39,7 @@
 #else
 #include <AL/alc.h>
 #include <AL/al.h>
+#include <AL/alext.h>
 #endif
 
 namespace love