Installed with PulseAudio are the PulseAudio utilities (pulseaudio-utils package). These are command-line utilities for managing PulseAudio and playing sound files. The paplay and pacat will play sound files; pactl will let you control the sound server; and pacmd lets you reconfigure it. Check the man pages for each for more details.
Sound Tool | Description |
---|---|
pabrowse | List PulseAudio sound servers |
pacat | Play, record, and configure a raw audio stream |
pacmd | Generates a shell for entering configuration commands |
pactl | Control a PulseAudio server, changing input and output sources and providing information about the server. |
padsp | PulseAudio wrapper for OSS sound applications |
pamon | Link to pacat |
paplay | Playback audio. The -d option specifies the output device, the -s option specifies the server, and the –volume option sets the volume (link to pacat) |
parec | Record and audio stream (link to pacat) |
parecord | Record and audio stream (link to pacat) |
pasuspender | Suspend a PulseAudio server |
pax11publish | Access PulseAudio server credentials |
pactl or pacmd, these two commands do basically the same thing. pacmd is the interactive version with more options. For example, pacmd with the command list-sinks includes the following:
name: [alsa_output.pci-0000_00_1b.0.analog-stereo] driver: [module-alsa-card.c] flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY state: SUSPENDED suspend cause: IDLE priority: 9959 volume: 0: 93% 1: 93% 0: -1.88 dB 1: -1.88 dB balance 0.00 base volume: 100% 0.00 dB volume steps: 65537 ...
Using pactl, you can load the module module-loopback with this:
$ pactl load-module module-loopback latency_msec=1
When the module is loaded, sound is internally routed from the input device to the output device. The latency is effectively zero.
In case you encounter the below error:
pactl: command not found
You may try installing below package as per your choice of distribution.
Distribution | Command |
---|---|
Debian | apt-get install pulseaudio-utils |
Ubuntu | apt-get install pulseaudio-utils |
Alpine | apk add pulseaudio-utils |
Arch Linux | pacman -S libpulse |
Kali Linux | apt-get install pulseaudio-utils |
CentOS | yum install pulseaudio-utils |
Fedora | dnf install pulseaudio-utils |
Raspbian | apt-get install pulseaudio-utils |
Docker | docker run cmd.cat/pactl pactl |