added -P (--playback) and -C (--capture) options to specify the

stream explicitly regardless of its program name.
This commit is contained in:
Takashi Iwai 2002-08-27 16:33:28 +00:00
parent a07a85bf5e
commit a00e467d67

View file

@ -305,6 +305,8 @@ int main(int argc, char *argv[])
{"buffer-time", 1, 0, 'B'},
{"verbose", 0, 0, 'v'},
{"separate-channels", 0, 0, 'I'},
{"playback", 0, 0, 'P'},
{"capture", 0, 0, 'C'},
{0, 0, 0, 0}
};
char *pcm_name = "default";
@ -436,6 +438,17 @@ int main(int argc, char *argv[])
case 'I':
interleaved = 0;
break;
case 'P':
stream = SND_PCM_STREAM_PLAYBACK;
command = "aplay";
break;
case 'C':
stream = SND_PCM_STREAM_CAPTURE;
command = "arecord";
start_delay = 1;
if (file_type == FORMAT_DEFAULT)
file_type = FORMAT_WAVE;
break;
default:
fprintf(stderr, "Try `%s --help' for more information.\n", command);
return 1;