Reluctantly add support for stereo files again: there are external hangars which did not update to the mono-files only principle
This commit is contained in:
parent
c48a28beb9
commit
9b4f1b0ff8
@ -59,9 +59,13 @@ namespace
|
||||
if (!compressed) {
|
||||
if (numChannels == 1 && bitsPerSample == 16) rv = SG_SAMPLE_MONO16;
|
||||
else if (numChannels == 1 && bitsPerSample == 8) rv = SG_SAMPLE_MONO8;
|
||||
else if (numChannels == 2 && bitsPerSample == 16) rv = SG_SAMPLE_STEREO16;
|
||||
else if (numChannels == 2 && bitsPerSample == 8) rv = SG_SAMPLE_STEREO8;
|
||||
else throw sg_exception("Unsupported audio format");
|
||||
} else {
|
||||
if (numChannels == 1 && bitsPerSample == 4) rv = SG_SAMPLE_ADPCM;
|
||||
else if (numChannels == 1 && bitsPerSample == 8) rv = SG_SAMPLE_MULAW;
|
||||
else throw sg_exception("Unsupported audio format");
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -47,7 +47,10 @@ enum {
|
||||
SG_SAMPLE_MONO8 = (SG_SAMPLE_MONO|SG_SAMPLE_8BITS),
|
||||
SG_SAMPLE_MONO16 = (SG_SAMPLE_MONO|SG_SAMPLE_16BITS),
|
||||
SG_SAMPLE_MULAW = (SG_SAMPLE_MONO|SG_SAMPLE_8BITS|SG_SAMPLE_COMPRESSED),
|
||||
SG_SAMPLE_ADPCM = (SG_SAMPLE_MONO|SG_SAMPLE_4BITS|SG_SAMPLE_COMPRESSED)
|
||||
SG_SAMPLE_ADPCM = (SG_SAMPLE_MONO|SG_SAMPLE_4BITS|SG_SAMPLE_COMPRESSED),
|
||||
|
||||
SG_SAMPLE_STEREO8 = (SG_SAMPLE_STEREO|SG_SAMPLE_8BITS),
|
||||
SG_SAMPLE_STEREO16 = (SG_SAMPLE_STEREO|SG_SAMPLE_16BITS)
|
||||
};
|
||||
|
||||
|
||||
|
@ -586,6 +586,12 @@ unsigned int SGSoundMgr::request_buffer(SGSoundSample *sample)
|
||||
case SG_SAMPLE_ADPCM:
|
||||
format = AL_FORMAT_MONO_IMA4;
|
||||
break;
|
||||
|
||||
case SG_SAMPLE_STEREO16:
|
||||
format = AL_FORMAT_STEREO16;
|
||||
break;
|
||||
case SG_SAMPLE_STEREO8:
|
||||
format = AL_FORMAT_STEREO8;
|
||||
default:
|
||||
SG_LOG(SG_SOUND, SG_ALERT, "unsupported audio format");
|
||||
return buffer;
|
||||
|
Loading…
Reference in New Issue
Block a user