SDL_mixer: Updated with audio format name changes

From 489716b38b7293f2539f37714dc0890cbace37c5 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 4 Sep 2023 10:48:16 -0700
Subject: [PATCH] Updated with audio format name changes

---
 src/codecs/load_aiff.c         |  2 +-
 src/codecs/music_drflac.c      |  2 +-
 src/codecs/music_drmp3.c       |  2 +-
 src/codecs/music_ogg_stb.c     |  2 +-
 src/codecs/music_opus.c        |  2 +-
 src/codecs/music_wav.c         | 28 ++++++++++++++--------------
 src/codecs/music_xmp.c         |  2 +-
 src/codecs/timidity/timidity.c | 14 +++++++-------
 src/effect_position.c          | 10 +++++-----
 9 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/src/codecs/load_aiff.c b/src/codecs/load_aiff.c
index b243d758..846d822c 100644
--- a/src/codecs/load_aiff.c
+++ b/src/codecs/load_aiff.c
@@ -236,7 +236,7 @@ SDL_AudioSpec *Mix_LoadAIFF_RW (SDL_RWops *src, SDL_bool freesrc,
             spec->format = SDL_AUDIO_S8;
             break;
         case 16:
-            spec->format = SDL_AUDIO_S16MSB;
+            spec->format = SDL_AUDIO_S16BE;
             break;
         default:
             Mix_SetError("Unsupported AIFF samplesize");
diff --git a/src/codecs/music_drflac.c b/src/codecs/music_drflac.c
index 8daba79d..6be58e4e 100644
--- a/src/codecs/music_drflac.c
+++ b/src/codecs/music_drflac.c
@@ -185,7 +185,7 @@ static void *DRFLAC_CreateFromRW(SDL_RWops *src, SDL_bool freesrc)
     }
 
     /* We should have channels and sample rate set up here */
-    srcspec.format = SDL_AUDIO_S16SYS;
+    srcspec.format = SDL_AUDIO_S16;
     srcspec.channels = music->channels;
     srcspec.freq = music->sample_rate;
     music->stream = SDL_CreateAudioStream(&srcspec, &music_spec);
diff --git a/src/codecs/music_drmp3.c b/src/codecs/music_drmp3.c
index 79345707..34a35e7a 100644
--- a/src/codecs/music_drmp3.c
+++ b/src/codecs/music_drmp3.c
@@ -112,7 +112,7 @@ static void *DRMP3_CreateFromRW(SDL_RWops *src, SDL_bool freesrc)
     }
 
     music->channels = music->dec.channels;
-    srcspec.format = SDL_AUDIO_S16SYS;
+    srcspec.format = SDL_AUDIO_S16;
     srcspec.channels = music->channels;
     srcspec.freq = (int)music->dec.sampleRate;
     music->stream = SDL_CreateAudioStream(&srcspec, &music_spec);
diff --git a/src/codecs/music_ogg_stb.c b/src/codecs/music_ogg_stb.c
index 420e6698..80e79811 100644
--- a/src/codecs/music_ogg_stb.c
+++ b/src/codecs/music_ogg_stb.c
@@ -142,7 +142,7 @@ static int OGG_UpdateSection(OGG_music *music)
         music->stream = NULL;
     }
 
-    srcspec.format = SDL_AUDIO_F32SYS;
+    srcspec.format = SDL_AUDIO_F32;
     srcspec.channels = vi.channels;
     srcspec.freq = (int)vi.sample_rate;
     music->stream = SDL_CreateAudioStream(&srcspec, &music_spec);
diff --git a/src/codecs/music_opus.c b/src/codecs/music_opus.c
index 6c01ed6f..b8c9d16e 100644
--- a/src/codecs/music_opus.c
+++ b/src/codecs/music_opus.c
@@ -188,7 +188,7 @@ static int OPUS_UpdateSection(OPUS_music *music)
         music->stream = NULL;
     }
 
-    srcspec.format = SDL_AUDIO_S16SYS;
+    srcspec.format = SDL_AUDIO_S16;
     srcspec.channels = op_info->channel_count;
     srcspec.freq = 48000;
     music->stream = SDL_CreateAudioStream(&srcspec, &music_spec);
diff --git a/src/codecs/music_wav.c b/src/codecs/music_wav.c
index f464ddcc..fad3a2b4 100644
--- a/src/codecs/music_wav.c
+++ b/src/codecs/music_wav.c
@@ -1898,12 +1898,12 @@ static SDL_bool LoadAIFFMusic(WAV_Music *wave)
         case raw_: spec->format = SDL_AUDIO_U8; break;
         case sowt: spec->format = SDL_AUDIO_S8; break;
         case ulaw:
-            spec->format = SDL_AUDIO_S16LSB;
+            spec->format = SDL_AUDIO_S16LE;
             wave->encoding = MULAW_CODE;
             wave->decode = fetch_ulaw;
             break;
         case alaw:
-            spec->format = SDL_AUDIO_S16LSB;
+            spec->format = SDL_AUDIO_S16LE;
             wave->encoding = ALAW_CODE;
             wave->decode = fetch_alaw;
             break;
@@ -1912,17 +1912,17 @@ static SDL_bool LoadAIFFMusic(WAV_Music *wave)
         break;
     case 16:
         if (!is_AIFC)
-            spec->format = SDL_AUDIO_S16MSB;
+            spec->format = SDL_AUDIO_S16BE;
         else switch (compressionType) {
-        case sowt: spec->format = SDL_AUDIO_S16LSB; break;
-        case NONE: spec->format = SDL_AUDIO_S16MSB; break;
+        case sowt: spec->format = SDL_AUDIO_S16LE; break;
+        case NONE: spec->format = SDL_AUDIO_S16BE; break;
         case ULAW:
-            spec->format = SDL_AUDIO_S16LSB;
+            spec->format = SDL_AUDIO_S16LE;
             wave->encoding = MULAW_CODE;
             wave->decode = fetch_ulaw;
             break;
         case ALAW:
-            spec->format = SDL_AUDIO_S16LSB;
+            spec->format = SDL_AUDIO_S16LE;
             wave->encoding = ALAW_CODE;
             wave->decode = fetch_alaw;
             break;
@@ -1933,21 +1933,21 @@ static SDL_bool LoadAIFFMusic(WAV_Music *wave)
         wave->encoding = PCM_CODE;
         wave->decode = fetch_pcm24be;
         if (!is_AIFC)
-            spec->format = SDL_AUDIO_S32MSB;
+            spec->format = SDL_AUDIO_S32BE;
         else switch (compressionType) {
-        case sowt: spec->format = SDL_AUDIO_S32LSB; break;
-        case NONE: spec->format = SDL_AUDIO_S32MSB; break;
+        case sowt: spec->format = SDL_AUDIO_S32LE; break;
+        case NONE: spec->format = SDL_AUDIO_S32BE; break;
         default: goto unsupported_format;
         }
         break;
     case 32:
         if (!is_AIFC)
-            spec->format = SDL_AUDIO_S32MSB;
+            spec->format = SDL_AUDIO_S32BE;
         else switch (compressionType) {
-        case sowt: spec->format = SDL_AUDIO_S32LSB; break;
-        case NONE: spec->format = SDL_AUDIO_S32MSB; break;
+        case sowt: spec->format = SDL_AUDIO_S32LE; break;
+        case NONE: spec->format = SDL_AUDIO_S32BE; break;
         case fl32:
-        case FL32: spec->format = SDL_AUDIO_F32MSB; break;
+        case FL32: spec->format = SDL_AUDIO_F32BE; break;
         default: goto unsupported_format;
         }
         break;
diff --git a/src/codecs/music_xmp.c b/src/codecs/music_xmp.c
index 6ca237a9..93ed4593 100644
--- a/src/codecs/music_xmp.c
+++ b/src/codecs/music_xmp.c
@@ -243,7 +243,7 @@ void *XMP_CreateFromRW(SDL_RWops *src, SDL_bool freesrc)
     }
 
     music->volume = MIX_MAX_VOLUME;
-    srcspec.format = SDL_AUDIO_S16SYS;
+    srcspec.format = SDL_AUDIO_S16;
     srcspec.channels = 2;
     srcspec.freq = music_spec.freq;
     music->stream = SDL_CreateAudioStream(&srcspec, &music_spec);
diff --git a/src/codecs/timidity/timidity.c b/src/codecs/timidity/timidity.c
index f9c9fe82..7ccd167d 100644
--- a/src/codecs/timidity/timidity.c
+++ b/src/codecs/timidity/timidity.c
@@ -558,25 +558,25 @@ static void do_song_load(SDL_RWops *rw, SDL_AudioSpec *audio, MidiSong **out)
       goto fail;
   }
   switch (audio->format) {
-  case SDL_AUDIO_S8 :
+  case SDL_AUDIO_S8:
     song->write = timi_s32tos8;
     break;
-  case SDL_AUDIO_U8 :
+  case SDL_AUDIO_U8:
     song->write = timi_s32tou8;
     break;
-  case SDL_AUDIO_S16LSB :
+  case SDL_AUDIO_S16LE:
     song->write = timi_s32tos16l;
     break;
-  case SDL_AUDIO_S16MSB :
+  case SDL_AUDIO_S16BE:
     song->write = timi_s32tos16b;
     break;
-  case SDL_AUDIO_S32LSB :
+  case SDL_AUDIO_S32LE:
     song->write = timi_s32tos32l;
     break;
-  case SDL_AUDIO_S32MSB :
+  case SDL_AUDIO_S32BE:
     song->write = timi_s32tos32b;
     break;
-  case SDL_AUDIO_F32SYS :
+  case SDL_AUDIO_F32:
     song->write = timi_s32tof32;
     break;
   default:
diff --git a/src/effect_position.c b/src/effect_position.c
index e5663675..a166eabc 100644
--- a/src/effect_position.c
+++ b/src/effect_position.c
@@ -1378,7 +1378,7 @@ static Mix_EffectFunc_t get_position_effect_func(Uint16 format, int channels)
             }
             break;
 
-        case SDL_AUDIO_S16LSB :
+        case SDL_AUDIO_S16LE:
             switch (channels) {
             case 1:
             case 2:
@@ -1396,7 +1396,7 @@ static Mix_EffectFunc_t get_position_effect_func(Uint16 format, int channels)
             }
             break;
 
-        case SDL_AUDIO_S16MSB :
+        case SDL_AUDIO_S16BE:
             switch (channels) {
             case 1:
             case 2:
@@ -1414,7 +1414,7 @@ static Mix_EffectFunc_t get_position_effect_func(Uint16 format, int channels)
             }
             break;
 
-        case SDL_AUDIO_S32MSB :
+        case SDL_AUDIO_S32BE:
             switch (channels) {
             case 1:
             case 2:
@@ -1432,7 +1432,7 @@ static Mix_EffectFunc_t get_position_effect_func(Uint16 format, int channels)
             }
             break;
 
-        case SDL_AUDIO_S32LSB :
+        case SDL_AUDIO_S32LE:
             switch (channels) {
             case 1:
             case 2:
@@ -1450,7 +1450,7 @@ static Mix_EffectFunc_t get_position_effect_func(Uint16 format, int channels)
             }
             break;
 
-        case SDL_AUDIO_F32SYS :
+        case SDL_AUDIO_F32:
             switch (channels) {
             case 1:
             case 2: