Remove support for stereo sounds

This commit is contained in:
Erik Hofman 2016-05-27 10:52:04 +02:00
parent 4b7d577883
commit c654c82a3f
2 changed files with 18 additions and 22 deletions

View File

@ -92,18 +92,14 @@ void SGSoundSample::set_format_AL( int fmt )
case AL_FORMAT_MONO16: case AL_FORMAT_MONO16:
_tracks = 1; _bits = 16; _compressed = false; _tracks = 1; _bits = 16; _compressed = false;
break; break;
case AL_FORMAT_STEREO8:
_tracks = 2; _bits = 8; _compressed = false;
break;
case AL_FORMAT_STEREO16:
_tracks = 2; _bits = 16; _compressed = false;
break;
#ifdef AL_EXT_MULAW_MCFORMATS #ifdef AL_EXT_MULAW_MCFORMATS
case AL_FORMAT_MONO_MULAW: case AL_FORMAT_MONO_MULAW:
_tracks = 1; _bits = 16; _compressed = true; _tracks = 1; _bits = 8; _compressed = true;
break; break;
case AL_FORMAT_STEREO_MULAW: #endif
_tracks = 2; _bits = 16; _compressed = true; #ifdef AL_EXT_IMA4
case AL_EXT_IMA4:
_tracks = 1; _bits = 4; _compressed = true;
break; break;
#endif #endif
default: default:
@ -116,11 +112,13 @@ unsigned int SGSoundSampleInfo::get_format_AL()
unsigned int rv = AL_FORMAT_MONO16; unsigned int rv = AL_FORMAT_MONO16;
if (_tracks == 1 && _bits == 8) rv = AL_FORMAT_MONO8; if (_tracks == 1 && _bits == 8) rv = AL_FORMAT_MONO8;
else if (_tracks == 2 && _bits == 8) rv = AL_FORMAT_STEREO8;
else if (_tracks == 2 && _bits == 16) rv = AL_FORMAT_STEREO16;
#ifdef AL_EXT_MULAW_MCFORMATS #ifdef AL_EXT_MULAW_MCFORMATS
else if (_tracks == 1 && _bits == 16 && _compressed) rv = AL_FORMAT_MONO_MULAW; else if (_tracks == 1 && _bits == 8 && _compressed)
else if (_tracks == 2 && _bits == 16 && _compressed) rv = AL_FORMAT_STEREO_MULAW; rv = AL_FORMAT_MONO_MULAW;
#endif
#ifdef AL_EXT_IMA4
else if (_tracks == 1 && _bits == 4 && _compressed)
rv = AL_EXT_IMA4;
#endif #endif
return rv; return rv;

View File

@ -40,14 +40,13 @@ enum {
SG_SAMPLE_8BITS = 8, SG_SAMPLE_8BITS = 8,
SG_SAMPLE_16BITS = 16, SG_SAMPLE_16BITS = 16,
SG_SAMPLE_UNCOMPRESSED = 0,
SG_SAMPLE_COMPRESSED = 256, SG_SAMPLE_COMPRESSED = 256,
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_STEREO8 = (SG_SAMPLE_STEREO|SG_SAMPLE_8BITS), SG_SAMPLE_MULAW = (SG_SAMPLE_MONO|SG_SAMPLE_8BITS|SG_SAMPLE_COMPRESSED),
SG_SAMPLE_STEREO16 = (SG_SAMPLE_STEREO|SG_SAMPLE_16BITS), SG_SAMPLE_ADPCM = (SG_SAMPLE_MONO|SG_SAMPLE_4BITS|SG_SAMPLE_COMPRESSED)
SG_SAMPLE_MONO_MULAW = (SG_SAMPLE_MONO16|SG_SAMPLE_COMPRESSED),
SG_SAMPLE_STEREO_MULAW = (SG_SAMPLE_STEREO16|SG_SAMPLE_COMPRESSED)
}; };
@ -102,9 +101,8 @@ public:
* @return Data size * @return Data size
*/ */
inline size_t get_size() const { inline size_t get_size() const {
printf("<-- samples: %i, tracks: %i, bits: %i\n", _samples, _tracks, _bits); return (_samples * _tracks * _bits)/8;
return (_samples * _tracks * _bits)/8; }
}
/** /**