-
Notifications
You must be signed in to change notification settings - Fork 295
Home
On Linux, we use ALSA (Advanced Linux Sound Architecture) to record and play.
We can use tools such as arecord
, aplay
, speaker-test
, alsamixer
, audacity
, pulseaudio
, pavucontrol
and etc.
speaker-test -D plughw:0
Note: plughw:0
instead of hw:0
is used, as ALSA plug plugin helps to convert any format to a hardware supported format.
Record an audio with 16000 sample rate and single chanel and play it.
arecord -v -f S16_LE -r 16000 -c 1 -D plughw:0 mono_16k.wav
aplay -v -D plughw:0 mono_16k.wav
or directly pipe input to output:
arecord -f cd | aplay -v
Change the sound card's volumes
alsamixer -D hw:0
To support multiple applications to record and play simultaneously, try alsa dmix plugins.
The used ALSA plugins in the configuration are asym, dmix, dsnoop and plug. Now you can use arecord and audacity to record at the some time.
If you can't record or play, try to change the value of ipc_key
to another value.