最終更新:2024-11-30 (土) 05:53:53 (8d)
snd_pcm_set_params
Top / snd_pcm_set_params
Set the hardware and software parameters in a simple way.
https://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#ga45d50841b307f2156fce1857bfac228c
パラメータ
snd_pcm_t* | pcm | PCM handle |
snd_pcm_format_t | format | required PCM format |
snd_pcm_access_t | access | required PCM access |
unsigned int | channels | required PCM channels |
unsigned int | rate | required sample rate in Hz |
int | soft_resample | 0 = disallow alsa-lib resample stream, 1 = allow resampling |
unsigned int | latency | required overall latency in us |
実装
例
- https://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_min_8c-example.html
err = snd_pcm_set_params(handle, SND_PCM_FORMAT_U8, SND_PCM_ACCESS_RW_INTERLEAVED, 1, 48000, 1, 500000)) < 0)