int32 support for windib and windx5 audio backends.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 01 Sep 2006 07:50:36 +0000
changeset 20084ad1e863d100
parent 2007 cff63f857ff3
child 2009 f2058fb367e4
int32 support for windib and windx5 audio backends.
src/audio/windib/SDL_dibaudio.c
src/audio/windx5/SDL_dx5audio.c
     1.1 --- a/src/audio/windib/SDL_dibaudio.c	Fri Sep 01 06:55:41 2006 +0000
     1.2 +++ b/src/audio/windib/SDL_dibaudio.c	Fri Sep 01 07:50:36 2006 +0000
     1.3 @@ -248,7 +248,7 @@
     1.4      waveformat.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 @@ -259,6 +259,11 @@
    1.13          spec->format = AUDIO_S16;
    1.14          waveformat.wBitsPerSample = 16;
    1.15          break;
    1.16 +    case 16:
    1.17 +        /* Signed 32 bit audio data */
    1.18 +        spec->format = AUDIO_S32;
    1.19 +        waveformat.wBitsPerSample = 32;
    1.20 +        break;
    1.21      default:
    1.22          SDL_SetError("Unsupported audio format");
    1.23          return (-1);
     2.1 --- a/src/audio/windx5/SDL_dx5audio.c	Fri Sep 01 06:55:41 2006 +0000
     2.2 +++ b/src/audio/windx5/SDL_dx5audio.c	Fri Sep 01 07:50:36 2006 +0000
     2.3 @@ -658,7 +658,7 @@
     2.4      waveformat.wFormatTag = WAVE_FORMAT_PCM;
     2.5  
     2.6      /* Determine the audio parameters from the AudioSpec */
     2.7 -    switch (spec->format & 0xFF) {
     2.8 +    switch (SDL_AUDIO_BITSIZE(spec->format)) {
     2.9      case 8:
    2.10          /* Unsigned 8 bit audio data */
    2.11          spec->format = AUDIO_U8;
    2.12 @@ -671,6 +671,12 @@
    2.13          silence = 0x00;
    2.14          waveformat.wBitsPerSample = 16;
    2.15          break;
    2.16 +    case 32:
    2.17 +        /* Signed 32 bit audio data */
    2.18 +        spec->format = AUDIO_S32;
    2.19 +        silence = 0x00;
    2.20 +        waveformat.wBitsPerSample = 32;
    2.21 +        break;
    2.22      default:
    2.23          SDL_SetError("Unsupported audio format");
    2.24          return (-1);