Added snd_pcm_hw_params_set_rate_resample function

- snd_pcm_hw_params_set_rate_resample()
- snd_pcm_hw_params_get_rate_resample()
This commit is contained in:
Jaroslav Kysela 2005-04-12 12:09:55 +00:00
parent 72ad0e9ae7
commit f65d9f3108
9 changed files with 72 additions and 4 deletions

View file

@ -51,6 +51,7 @@ int block = 0; /* block mode */
int tick_time = 0; /* disabled, otherwise in us */
int tick_time_ok = 0;
int use_poll = 0;
int resample = 1;
unsigned long loop_limit;
snd_output_t *output = NULL;
@ -67,6 +68,11 @@ int setparams_stream(snd_pcm_t *handle,
printf("Broken configuration for %s PCM: no configurations available: %s\n", snd_strerror(err), id);
return err;
}
err = snd_pcm_hw_params_set_rate_resample(handle, params, resample);
if (err < 0) {
printf("Resample setup failed for %s (val %i): %s\n", id, resample, snd_strerror(err));
return err;
}
err = snd_pcm_hw_params_set_access(handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
if (err < 0) {
printf("Access type not available for %s: %s\n", id, snd_strerror(err));
@ -518,7 +524,7 @@ int main(int argc, char *argv[])
morehelp = 0;
while (1) {
int c;
if ((c = getopt_long(argc, argv, "hP:C:m:M:F:f:c:r:s:bt:pe", long_option, NULL)) < 0)
if ((c = getopt_long(argc, argv, "hP:C:m:M:F:f:c:r:s:bt:pen", long_option, NULL)) < 0)
break;
switch (c) {
case 'h':
@ -580,6 +586,9 @@ int main(int argc, char *argv[])
case 'e':
effect = 1;
break;
case 'n':
resample = 0;
break;
}
}