HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

aplay — Sound player for ALSA soundcard driver. More information: <https://manned.org/aplay>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
soundcommandaplayclisoundcardplayerforalsa
linux

Problem

How to use the aplay command: Sound player for ALSA soundcard driver. More information: <https://manned.org/aplay>.

Solution

aplay — Sound player for ALSA soundcard driver. More information: <https://manned.org/aplay>.

Play a specific file (sampling rate, bit depth, etc. will be automatically determined for the file format):
aplay {{path/to/file}}


Play the first 10 seconds of a specific file at 2500 Hz:
aplay {{[-d|--duration]}} {{10}} {{[-r|--rate]}} {{2500}} {{path/to/file}}


Play the raw file as a 22050 Hz, mono, 8-bit, Mu-Law .au file:
aplay {{[-c|--channels]}} {{1}} {{[-t|--file-type]}} {{raw}} {{[-r|--rate]}} {{22050}} {{[-f|--format]}} {{mu_law}} {{path/to/file}}


List available audio devices:
aplay {{[-l|--list-devices]}}

Code Snippets

Play a specific file (sampling rate, bit depth, etc. will be automatically determined for the file format)

aplay {{path/to/file}}

Play the first 10 seconds of a specific file at 2500 Hz

aplay {{[-d|--duration]}} {{10}} {{[-r|--rate]}} {{2500}} {{path/to/file}}

Play the raw file as a 22050 Hz, mono, 8-bit, Mu-Law `.au` file

aplay {{[-c|--channels]}} {{1}} {{[-t|--file-type]}} {{raw}} {{[-r|--rate]}} {{22050}} {{[-f|--format]}} {{mu_law}} {{path/to/file}}

List available audio devices

aplay {{[-l|--list-devices]}}

Context

tldr-pages: linux/aplay

Revisions (0)

No revisions yet.