kopia lustrzana https://github.com/xdsopl/robot36
set min rate to 8000 to work around pulseaudio ignorance
pulseaudio ignores our request no to do any rate conversion. so we need to set the min rate to 8000hz so we wont get 1hz :Smaster
rodzic
93c8bad3c6
commit
d1ed93501d
9
alsa.c
9
alsa.c
|
@ -125,6 +125,15 @@ int open_alsa_read(struct pcm **p, char *name)
|
|||
return 0;
|
||||
}
|
||||
|
||||
unsigned rate_min = 8000;
|
||||
int dir_min = 1;
|
||||
if (snd_pcm_hw_params_set_rate_min(pcm, params, &rate_min, &dir_min) < 0 || rate_min < 8000) {
|
||||
fprintf(stderr, "Error setting min rate.\n");
|
||||
snd_pcm_close(alsa->pcm);
|
||||
free(alsa);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (snd_pcm_hw_params(pcm, params) < 0) {
|
||||
fprintf(stderr, "Error setting HW params.\n");
|
||||
snd_pcm_close(alsa->pcm);
|
||||
|
|
Ładowanie…
Reference in New Issue