|
|
|
@ -88,6 +88,51 @@ static ALenum getALFormat(ChannelConfig chans, SampleType type)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(alIsExtensionPresent("AL_EXT_FLOAT32"))
|
|
|
|
|
{
|
|
|
|
|
static const struct {
|
|
|
|
|
char name[32];
|
|
|
|
|
ChannelConfig chans;
|
|
|
|
|
SampleType type;
|
|
|
|
|
} fltfmtlist[] = {
|
|
|
|
|
{ "AL_FORMAT_MONO_FLOAT32", ChannelConfig_Mono, SampleType_Float32 },
|
|
|
|
|
{ "AL_FORMAT_STEREO_FLOAT32", ChannelConfig_Stereo, SampleType_Float32 },
|
|
|
|
|
};
|
|
|
|
|
static const size_t fltfmtlistsize = sizeof(fltfmtlist)/sizeof(fltfmtlist[0]);
|
|
|
|
|
|
|
|
|
|
for(size_t i = 0;i < fltfmtlistsize;i++)
|
|
|
|
|
{
|
|
|
|
|
if(fltfmtlist[i].chans == chans && fltfmtlist[i].type == type)
|
|
|
|
|
{
|
|
|
|
|
ALenum format = alGetEnumValue(fltfmtlist[i].name);
|
|
|
|
|
if(format != 0 && format != -1)
|
|
|
|
|
return format;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(alIsExtensionPresent("AL_EXT_MCFORMATS"))
|
|
|
|
|
{
|
|
|
|
|
static const struct {
|
|
|
|
|
char name[32];
|
|
|
|
|
ChannelConfig chans;
|
|
|
|
|
SampleType type;
|
|
|
|
|
} fltmcfmtlist[] = {
|
|
|
|
|
{ "AL_FORMAT_QUAD32", ChannelConfig_Quad, SampleType_Float32 },
|
|
|
|
|
{ "AL_FORMAT_51CHN32", ChannelConfig_5point1, SampleType_Float32 },
|
|
|
|
|
{ "AL_FORMAT_71CHN32", ChannelConfig_7point1, SampleType_Float32 },
|
|
|
|
|
};
|
|
|
|
|
static const size_t fltmcfmtlistsize = sizeof(fltmcfmtlist)/sizeof(fltmcfmtlist[0]);
|
|
|
|
|
|
|
|
|
|
for(size_t i = 0;i < fltmcfmtlistsize;i++)
|
|
|
|
|
{
|
|
|
|
|
if(fltmcfmtlist[i].chans == chans && fltmcfmtlist[i].type == type)
|
|
|
|
|
{
|
|
|
|
|
ALenum format = alGetEnumValue(fltmcfmtlist[i].name);
|
|
|
|
|
if(format != 0 && format != -1)
|
|
|
|
|
return format;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fail(std::string("Unsupported sound format (")+getChannelConfigName(chans)+", "+getSampleTypeName(type)+")");
|
|
|
|
|
return AL_NONE;
|
|
|
|
|