mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
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:
parent
72ad0e9ae7
commit
f65d9f3108
9 changed files with 72 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue