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;
}
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)
};
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;