Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
int32 support for windib and windx5 audio backends.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 1, 2006
1 parent ac31727 commit de266e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/audio/windib/SDL_dibaudio.c
Expand Up @@ -248,7 +248,7 @@ DIB_OpenAudio(_THIS, SDL_AudioSpec * spec)
waveformat.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;
Expand All @@ -259,6 +259,11 @@ DIB_OpenAudio(_THIS, SDL_AudioSpec * spec)
spec->format = AUDIO_S16;
waveformat.wBitsPerSample = 16;
break;
case 16:
/* Signed 32 bit audio data */
spec->format = AUDIO_S32;
waveformat.wBitsPerSample = 32;
break;
default:
SDL_SetError("Unsupported audio format");
return (-1);
Expand Down
8 changes: 7 additions & 1 deletion src/audio/windx5/SDL_dx5audio.c
Expand Up @@ -658,7 +658,7 @@ DX5_OpenAudio(_THIS, SDL_AudioSpec * spec)
waveformat.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;
Expand All @@ -671,6 +671,12 @@ DX5_OpenAudio(_THIS, SDL_AudioSpec * spec)
silence = 0x00;
waveformat.wBitsPerSample = 16;
break;
case 32:
/* Signed 32 bit audio data */
spec->format = AUDIO_S32;
silence = 0x00;
waveformat.wBitsPerSample = 32;
break;
default:
SDL_SetError("Unsupported audio format");
return (-1);
Expand Down

0 comments on commit de266e5

Please sign in to comment.