ret = snd_pcm_hw_params_any(handle, hwparams);
ret |= snd_pcm_hw_params_set_access(handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED);
- ret |= snd_pcm_hw_params_set_format(handle, hwparams, SND_PCM_FORMAT_S16_LE);
+ ret |= snd_pcm_hw_params_set_format(handle, hwparams, SND_PCM_FORMAT_S16);
ret |= snd_pcm_hw_params_set_channels(handle, hwparams, stereo ? 2 : 1);
ret |= snd_pcm_hw_params_set_rate_near(handle, hwparams, &rate, 0);
ret |= snd_pcm_hw_params_set_buffer_size_near(handle, hwparams, &buffer_size);
int sndout_sdl_start(int rate, int stereo)
{
- SDL_AudioSpec desired;
+ SDL_AudioSpec desired = { 0 };
int samples, shift;
int ret;
sndout_sdl_stop();
desired.freq = rate;
- desired.format = AUDIO_S16LSB;
+ desired.format = AUDIO_S16SYS;
desired.channels = stereo ? 2 : 1;
desired.callback = callback;
desired.userdata = NULL;