Updated Tru64 audio to support int32.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 01 Sep 2006 06:43:41 +0000
changeset 2006b3741f227757
parent 2005 45af7d69f8eb
child 2007 cff63f857ff3
Updated Tru64 audio to support int32.
src/audio/mme/SDL_mmeaudio.c
     1.1 --- a/src/audio/mme/SDL_mmeaudio.c	Fri Sep 01 06:32:54 2006 +0000
     1.2 +++ b/src/audio/mme/SDL_mmeaudio.c	Fri Sep 01 06:43:41 2006 +0000
     1.3 @@ -135,7 +135,7 @@
     1.4      shm->wFmt.wf.wFormatTag = WAVE_FORMAT_PCM;
     1.5  
     1.6      /* Determine the audio parameters from the AudioSpec */
     1.7 -    switch (spec->format & 0xFF) {
     1.8 +    switch (SDL_AUDIO_BITSIZE(spec->format)) {
     1.9      case 8:
    1.10          /* Unsigned 8 bit audio data */
    1.11          spec->format = AUDIO_U8;
    1.12 @@ -146,11 +146,17 @@
    1.13          spec->format = AUDIO_S16;
    1.14          shm->wFmt.wBitsPerSample = 16;
    1.15          break;
    1.16 +    case 32:
    1.17 +        /* Signed 32 bit audio data */
    1.18 +        spec->format = AUDIO_S32;
    1.19 +        shm->wFmt.wBitsPerSample = 32;
    1.20 +        break;
    1.21      default:
    1.22          SDL_SetError("Unsupported audio format");
    1.23          return (-1);
    1.24      }
    1.25  
    1.26 +    /* !!! FIXME: Can this handle more than stereo? */
    1.27      shm->wFmt.wf.nChannels = spec->channels;
    1.28      shm->wFmt.wf.nSamplesPerSec = spec->freq;
    1.29      shm->wFmt.wf.nBlockAlign =