79 |
} |
} |
80 |
|
|
81 |
/* Set sample format */ |
/* Set sample format */ |
82 |
|
#if WORDS_BIGENDIAN |
83 |
|
if ((err = snd_pcm_hw_params_set_format(pcm_handle, hwparams, SND_PCM_FORMAT_S16_BE)) < 0) { |
84 |
|
#else // little endian |
85 |
if ((err = snd_pcm_hw_params_set_format(pcm_handle, hwparams, SND_PCM_FORMAT_S16_LE)) < 0) { |
if ((err = snd_pcm_hw_params_set_format(pcm_handle, hwparams, SND_PCM_FORMAT_S16_LE)) < 0) { |
86 |
|
#endif |
87 |
fprintf(stderr, "Error setting sample format. : %s\n", snd_strerror(err)); |
fprintf(stderr, "Error setting sample format. : %s\n", snd_strerror(err)); |
88 |
return EXIT_FAILURE; |
return EXIT_FAILURE; |
89 |
} |
} |
176 |
snd_pcm_close(pcm_handle); |
snd_pcm_close(pcm_handle); |
177 |
return false; |
return false; |
178 |
} |
} |
179 |
|
#if WORDS_BIGENDIAN |
180 |
|
if (snd_pcm_hw_params_test_format(pcm_handle, hwparams, SND_PCM_FORMAT_S16_BE) < 0) { |
181 |
|
#else // little endian |
182 |
if (snd_pcm_hw_params_test_format(pcm_handle, hwparams, SND_PCM_FORMAT_S16_LE) < 0) { |
if (snd_pcm_hw_params_test_format(pcm_handle, hwparams, SND_PCM_FORMAT_S16_LE) < 0) { |
183 |
|
#endif |
184 |
snd_pcm_close(pcm_handle); |
snd_pcm_close(pcm_handle); |
185 |
return false; |
return false; |
186 |
} |
} |