Update OpenAL Soft to 1.18.2

This commit is contained in:
Alex Szpakowski
2017-12-10 22:34:10 -04:00
parent 75e0077566
commit b160006eb1
152 changed files with 33572 additions and 15363 deletions
+37 -1
View File
@@ -38,6 +38,13 @@
#include "common/alhelpers.h"
#ifndef SDL_AUDIO_MASK_BITSIZE
#define SDL_AUDIO_MASK_BITSIZE (0xFF)
#endif
#ifndef SDL_AUDIO_BITSIZE
#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE)
#endif
#ifndef M_PI
#define M_PI (3.14159265358979323846)
#endif
@@ -61,6 +68,35 @@ void SDLCALL RenderSDLSamples(void *userdata, Uint8 *stream, int len)
}
static const char *ChannelsName(ALCenum chans)
{
switch(chans)
{
case ALC_MONO_SOFT: return "Mono";
case ALC_STEREO_SOFT: return "Stereo";
case ALC_QUAD_SOFT: return "Quadraphonic";
case ALC_5POINT1_SOFT: return "5.1 Surround";
case ALC_6POINT1_SOFT: return "6.1 Surround";
case ALC_7POINT1_SOFT: return "7.1 Surround";
}
return "Unknown Channels";
}
static const char *TypeName(ALCenum type)
{
switch(type)
{
case ALC_BYTE_SOFT: return "S8";
case ALC_UNSIGNED_BYTE_SOFT: return "U8";
case ALC_SHORT_SOFT: return "S16";
case ALC_UNSIGNED_SHORT_SOFT: return "U16";
case ALC_INT_SOFT: return "S32";
case ALC_UNSIGNED_INT_SOFT: return "U32";
case ALC_FLOAT_SOFT: return "Float32";
}
return "Unknown Type";
}
/* Creates a one second buffer containing a sine wave, and returns the new
* buffer ID. */
static ALuint CreateSineWave(void)
@@ -169,7 +205,7 @@ int main(int argc, char *argv[])
attrs[6] = 0; /* end of list */
playback.FrameSize = FramesToBytes(1, attrs[1], attrs[3]);
playback.FrameSize = obtained.channels * SDL_AUDIO_BITSIZE(obtained.format) / 8;
/* Initialize OpenAL loopback device, using our format attributes. */
playback.Device = alcLoopbackOpenDeviceSOFT(NULL);