mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-22 23:56:29 +01:00
Added cd and dat format shortcuts
This commit is contained in:
parent
35c721265c
commit
da6110d1a3
1 changed files with 19 additions and 6 deletions
|
@ -191,15 +191,18 @@ Usage: %s [OPTION]... [FILE]...
|
||||||
-B, --buffer-length=# buffer length is # milliseconds
|
-B, --buffer-length=# buffer length is # milliseconds
|
||||||
-A, --min-avail=# min available space for wakeup is # milliseconds
|
-A, --min-avail=# min available space for wakeup is # milliseconds
|
||||||
-v, --show-setup show actual setup
|
-v, --show-setup show actual setup
|
||||||
-I, --separate-channels one file for each channel\
|
-I, --separate-channels one file for each channel
|
||||||
", command, snd_cards()-1);
|
", command, snd_cards()-1);
|
||||||
fprintf(stderr, "\nRecognized sample formats are:");
|
fprintf(stderr, "Recognized sample formats are:");
|
||||||
for (k = 0; k < 32; ++k) {
|
for (k = 0; k < 32; ++k) {
|
||||||
const char *s = snd_pcm_get_format_name(k);
|
const char *s = snd_pcm_get_format_name(k);
|
||||||
if (s)
|
if (s)
|
||||||
fprintf(stderr, " %s", s);
|
fprintf(stderr, " %s", s);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\nSome of these may not be available on selected hardware\n");
|
fprintf(stderr, "\nSome of these may not be available on selected hardware\n");
|
||||||
|
fprintf(stderr, "The availabled format shortcuts are:\n");
|
||||||
|
fprintf(stderr, "cd (16 bit little endian, 44100, stereo)\n");
|
||||||
|
fprintf(stderr, "dat (16 bit little endian, 48000, stereo)\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void device_list(void)
|
static void device_list(void)
|
||||||
|
@ -448,11 +451,21 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
|
if (strcasecmp(optarg, "cd") == 0) {
|
||||||
|
rformat.format = SND_PCM_SFMT_S16_LE;
|
||||||
|
rformat.rate = 44100;
|
||||||
|
rformat.channels = 2;
|
||||||
|
} else if (strcasecmp(optarg, "dat") == 0) {
|
||||||
|
rformat.format = SND_PCM_SFMT_S16_LE;
|
||||||
|
rformat.rate = 48000;
|
||||||
|
rformat.channels = 2;
|
||||||
|
} else {
|
||||||
rformat.format = snd_pcm_get_format_value(optarg);
|
rformat.format = snd_pcm_get_format_value(optarg);
|
||||||
if (rformat.format < 0) {
|
if (rformat.format < 0) {
|
||||||
fprintf(stderr, "Error: wrong extended format '%s'\n", optarg);
|
fprintf(stderr, "Error: wrong extended format '%s'\n", optarg);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
tmp = atoi(optarg);
|
tmp = atoi(optarg);
|
||||||
|
|
Loading…
Reference in a new issue