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:
@@ -59,9 +59,13 @@ namespace
|
|||||||
if (!compressed) {
|
if (!compressed) {
|
||||||
if (numChannels == 1 && bitsPerSample == 16) rv = SG_SAMPLE_MONO16;
|
if (numChannels == 1 && bitsPerSample == 16) rv = SG_SAMPLE_MONO16;
|
||||||
else if (numChannels == 1 && bitsPerSample == 8) rv = SG_SAMPLE_MONO8;
|
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 {
|
} else {
|
||||||
if (numChannels == 1 && bitsPerSample == 4) rv = SG_SAMPLE_ADPCM;
|
if (numChannels == 1 && bitsPerSample == 4) rv = SG_SAMPLE_ADPCM;
|
||||||
else if (numChannels == 1 && bitsPerSample == 8) rv = SG_SAMPLE_MULAW;
|
else if (numChannels == 1 && bitsPerSample == 8) rv = SG_SAMPLE_MULAW;
|
||||||
|
else throw sg_exception("Unsupported audio format");
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,10 @@ enum {
|
|||||||
SG_SAMPLE_MONO8 = (SG_SAMPLE_MONO|SG_SAMPLE_8BITS),
|
SG_SAMPLE_MONO8 = (SG_SAMPLE_MONO|SG_SAMPLE_8BITS),
|
||||||
SG_SAMPLE_MONO16 = (SG_SAMPLE_MONO|SG_SAMPLE_16BITS),
|
SG_SAMPLE_MONO16 = (SG_SAMPLE_MONO|SG_SAMPLE_16BITS),
|
||||||
SG_SAMPLE_MULAW = (SG_SAMPLE_MONO|SG_SAMPLE_8BITS|SG_SAMPLE_COMPRESSED),
|
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:
|
case SG_SAMPLE_ADPCM:
|
||||||
format = AL_FORMAT_MONO_IMA4;
|
format = AL_FORMAT_MONO_IMA4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SG_SAMPLE_STEREO16:
|
||||||
|
format = AL_FORMAT_STEREO16;
|
||||||
|
break;
|
||||||
|
case SG_SAMPLE_STEREO8:
|
||||||
|
format = AL_FORMAT_STEREO8;
|
||||||
default:
|
default:
|
||||||
SG_LOG(SG_SOUND, SG_ALERT, "unsupported audio format");
|
SG_LOG(SG_SOUND, SG_ALERT, "unsupported audio format");
|
||||||
return buffer;
|
return buffer;
|
||||||
|
|||||||
Reference in New Issue
Block a user