Commit 176414e7 authored by Ryan C. Gordon's avatar Ryan C. Gordon

int32 support for windib and windx5 audio backends.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402055
parent aeb5fc04
...@@ -248,7 +248,7 @@ DIB_OpenAudio(_THIS, SDL_AudioSpec * spec) ...@@ -248,7 +248,7 @@ DIB_OpenAudio(_THIS, SDL_AudioSpec * spec)
waveformat.wFormatTag = WAVE_FORMAT_PCM; waveformat.wFormatTag = WAVE_FORMAT_PCM;
/* Determine the audio parameters from the AudioSpec */ /* Determine the audio parameters from the AudioSpec */
switch (spec->format & 0xFF) { switch (SDL_AUDIO_BITSIZE(spec->format)) {
case 8: case 8:
/* Unsigned 8 bit audio data */ /* Unsigned 8 bit audio data */
spec->format = AUDIO_U8; spec->format = AUDIO_U8;
...@@ -259,6 +259,11 @@ DIB_OpenAudio(_THIS, SDL_AudioSpec * spec) ...@@ -259,6 +259,11 @@ DIB_OpenAudio(_THIS, SDL_AudioSpec * spec)
spec->format = AUDIO_S16; spec->format = AUDIO_S16;
waveformat.wBitsPerSample = 16; waveformat.wBitsPerSample = 16;
break; break;
case 16:
/* Signed 32 bit audio data */
spec->format = AUDIO_S32;
waveformat.wBitsPerSample = 32;
break;
default: default:
SDL_SetError("Unsupported audio format"); SDL_SetError("Unsupported audio format");
return (-1); return (-1);
......
...@@ -658,7 +658,7 @@ DX5_OpenAudio(_THIS, SDL_AudioSpec * spec) ...@@ -658,7 +658,7 @@ DX5_OpenAudio(_THIS, SDL_AudioSpec * spec)
waveformat.wFormatTag = WAVE_FORMAT_PCM; waveformat.wFormatTag = WAVE_FORMAT_PCM;
/* Determine the audio parameters from the AudioSpec */ /* Determine the audio parameters from the AudioSpec */
switch (spec->format & 0xFF) { switch (SDL_AUDIO_BITSIZE(spec->format)) {
case 8: case 8:
/* Unsigned 8 bit audio data */ /* Unsigned 8 bit audio data */
spec->format = AUDIO_U8; spec->format = AUDIO_U8;
...@@ -671,6 +671,12 @@ DX5_OpenAudio(_THIS, SDL_AudioSpec * spec) ...@@ -671,6 +671,12 @@ DX5_OpenAudio(_THIS, SDL_AudioSpec * spec)
silence = 0x00; silence = 0x00;
waveformat.wBitsPerSample = 16; waveformat.wBitsPerSample = 16;
break; break;
case 32:
/* Signed 32 bit audio data */
spec->format = AUDIO_S32;
silence = 0x00;
waveformat.wBitsPerSample = 32;
break;
default: default:
SDL_SetError("Unsupported audio format"); SDL_SetError("Unsupported audio format");
return (-1); return (-1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment