使用alsa的工具aplay录音
./arecord -f S16_LE -c 2 -r 8000 -d 20 8k.wav #录音:16bit 小端,立体声,采样率8K,时间20s
注:将aplay命名为arecord,或者使用aplay -C
{"help", 0, 0, 'h'}, {"version", 0, 0, OPT_VERSION}, {"list-devices", 0, 0, 'l'}, {"list-pcms", 0, 0, 'L'}, {"device", 1, 0, 'D'}, {"quiet", 0, 0, 'q'}, {"file-type", 1, 0, 't'}, {"channels", 1, 0, 'c'}, {"format", 1, 0, 'f'}, {"rate", 1, 0, 'r'}, {"duration", 1, 0 ,'d'}, {"sleep-min", 1, 0, 's'}, {"mmap", 0, 0, 'M'}, {"nonblock", 0, 0, 'N'}, {"period-time", 1, 0, 'F'}, {"period-size", 1, 0, OPT_PERIOD_SIZE}, {"avail-min", 1, 0, 'A'}, {"start-delay", 1, 0, 'R'}, {"stop-delay", 1, 0, 'T'}, {"buffer-time", 1, 0, 'B'}, {"buffer-size", 1, 0, OPT_BUFFER_SIZE}, {"verbose", 0, 0, 'v'}, {"separate-channels", 0, 0, 'I'}, {"playback", 0, 0, 'P'}, {"capture", 0, 0, 'C'},