]> git.mxchange.org Git - simgear.git/commitdiff
Remove support for stereo sounds
authorErik Hofman <erik@ehofman.com>
Fri, 27 May 2016 08:52:04 +0000 (10:52 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 13 Aug 2016 08:21:16 +0000 (10:21 +0200)
simgear/sound/sample_openal.cxx
simgear/sound/sample_openal.hxx

index 3569606366a0d914fdba85869403bb59bbdf7aad..4abd27e0722ace7a4c4371a9e930d4b1f85ae48f 100644 (file)
@@ -92,18 +92,14 @@ void SGSoundSample::set_format_AL( int fmt )
     case AL_FORMAT_MONO16:
         _tracks = 1; _bits = 16; _compressed = false;
         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
     case AL_FORMAT_MONO_MULAW:
-        _tracks = 1; _bits = 16; _compressed = true;
+        _tracks = 1; _bits = 8; _compressed = true;
         break;
-    case AL_FORMAT_STEREO_MULAW:
-        _tracks = 2; _bits = 16; _compressed = true;
+#endif
+#ifdef AL_EXT_IMA4
+    case AL_EXT_IMA4:
+        _tracks = 1; _bits = 4; _compressed = true;
         break;
 #endif
     default:
@@ -116,11 +112,13 @@ unsigned int SGSoundSampleInfo::get_format_AL()
     unsigned int rv = AL_FORMAT_MONO16;
 
     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
-    else if (_tracks == 1 && _bits == 16 && _compressed) rv = AL_FORMAT_MONO_MULAW;
-    else if (_tracks == 2 && _bits == 16 && _compressed) rv = AL_FORMAT_STEREO_MULAW;
+    else if (_tracks == 1 && _bits == 8 && _compressed)
+        rv = AL_FORMAT_MONO_MULAW;
+#endif
+#ifdef AL_EXT_IMA4
+    else if (_tracks == 1 && _bits == 4 && _compressed) 
+        rv = AL_EXT_IMA4;
 #endif
 
     return rv;
index 8dc71b0bae066da945f06c005a63316f089d3769..34a54064029c188aec9cd82c890862fe54c37726 100644 (file)
@@ -40,14 +40,13 @@ enum {
     SG_SAMPLE_8BITS = 8,
     SG_SAMPLE_16BITS = 16,
 
+    SG_SAMPLE_UNCOMPRESSED = 0,
     SG_SAMPLE_COMPRESSED = 256,
 
-    SG_SAMPLE_MONO8        = (SG_SAMPLE_MONO|SG_SAMPLE_8BITS),
-    SG_SAMPLE_MONO16       = (SG_SAMPLE_MONO|SG_SAMPLE_16BITS),
-    SG_SAMPLE_STEREO8      = (SG_SAMPLE_STEREO|SG_SAMPLE_8BITS),
-    SG_SAMPLE_STEREO16     = (SG_SAMPLE_STEREO|SG_SAMPLE_16BITS),
-    SG_SAMPLE_MONO_MULAW   = (SG_SAMPLE_MONO16|SG_SAMPLE_COMPRESSED),
-    SG_SAMPLE_STEREO_MULAW = (SG_SAMPLE_STEREO16|SG_SAMPLE_COMPRESSED)
+    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)
 };
 
 
@@ -102,9 +101,8 @@ public:
      * @return Data size
      */
     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;
+    }
 
 
     /**