Alter the audio output parameters of the audio output device. Definition at line 67 of file audio_output_alsa.c. 00068 { 00069 snd_pcm_hw_params_t *devparam; 00070 00071 snd_pcm_hw_params_alloca(&devparam); 00072 00073 /* Acquire the standard parameters */ 00074 if (snd_pcm_hw_params_any(devhnd, devparam) != 0) 00075 return (-1); 00076 00077 /* Set the access method - XXX: mmap */ 00078 if (snd_pcm_hw_params_set_access(devhnd, devparam, 00079 SND_PCM_ACCESS_RW_INTERLEAVED) != 0) 00080 return (-1); 00081 00082 /* Output format */ 00083 if (snd_pcm_hw_params_set_format(devhnd, devparam, 00084 SND_PCM_FORMAT_S16) != 0) 00085 return (-1); 00086 /* Sample rate */ 00087 if (snd_pcm_hw_params_set_rate_near(devhnd, devparam, &srate, NULL) != 0) 00088 return (-1); 00089 /* Channels */ 00090 if (snd_pcm_hw_params_set_channels(devhnd, devparam, channels) != 0) 00091 return (-1); 00092 00093 /* Drain current data and make sure we aren't underrun */ 00094 snd_pcm_drain(devhnd); 00095 00096 /* Apply values */ 00097 if (snd_pcm_hw_params(devhnd, devparam) != 0) 00098 return (-1); 00099 00100 return (0); 00101 }
Here is the caller graph for this function:
![]() |
1.6.3