Updated Tru64 audio to support int32.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 01 Sep 2006 06:43:41 +0000
changeset 2006 b3741f227757
parent 2005 45af7d69f8eb
child 2007 cff63f857ff3
Updated Tru64 audio to support int32.
src/audio/mme/SDL_mmeaudio.c
--- a/src/audio/mme/SDL_mmeaudio.c	Fri Sep 01 06:32:54 2006 +0000
+++ b/src/audio/mme/SDL_mmeaudio.c	Fri Sep 01 06:43:41 2006 +0000
@@ -135,7 +135,7 @@
     shm->wFmt.wf.wFormatTag = WAVE_FORMAT_PCM;
 
     /* Determine the audio parameters from the AudioSpec */
-    switch (spec->format & 0xFF) {
+    switch (SDL_AUDIO_BITSIZE(spec->format)) {
     case 8:
         /* Unsigned 8 bit audio data */
         spec->format = AUDIO_U8;
@@ -146,11 +146,17 @@
         spec->format = AUDIO_S16;
         shm->wFmt.wBitsPerSample = 16;
         break;
+    case 32:
+        /* Signed 32 bit audio data */
+        spec->format = AUDIO_S32;
+        shm->wFmt.wBitsPerSample = 32;
+        break;
     default:
         SDL_SetError("Unsupported audio format");
         return (-1);
     }
 
+    /* !!! FIXME: Can this handle more than stereo? */
     shm->wFmt.wf.nChannels = spec->channels;
     shm->wFmt.wf.nSamplesPerSec = spec->freq;
     shm->wFmt.wf.nBlockAlign =