mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-03 06:17:44 -04:00
use native byte order for audio
This commit is contained in:
parent
3ccc039bba
commit
4e0bc79405
2 changed files with 3 additions and 3 deletions
|
@ -51,7 +51,7 @@ int sndout_alsa_start(int rate_, int stereo)
|
|||
|
||||
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);
|
||||
|
|
|
@ -62,7 +62,7 @@ int sndout_sdl_init(void)
|
|||
|
||||
int sndout_sdl_start(int rate, int stereo)
|
||||
{
|
||||
SDL_AudioSpec desired;
|
||||
SDL_AudioSpec desired = { 0 };
|
||||
int samples, shift;
|
||||
int ret;
|
||||
|
||||
|
@ -70,7 +70,7 @@ int sndout_sdl_start(int rate, int stereo)
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue