• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

aplay: command not found

by admin

aplay is a command-line utility for playing audio files on a Linux system. It is part of the ALSA (Advanced Linux Sound Architecture) utility suite, which provides audio support for Linux systems. aplay can be used to play a variety of audio file formats, including WAV, AIFF, AU, and MP3.

To use aplay, you will need to specify the name of the audio file you want to play as an argument. For example:

# aplay mysong.wav

You can also specify options to control the way aplay plays the audio file. For example, you can use the -D option to specify the name of the audio device to use, or the -c option to specify the number of channels in the audio file.

Here is an example of how to use aplay with some options:

# aplay -D hw:0,0 -c 2 mysong.wav

This will play the audio file mysong.wav using the audio device hw:0,0 and with 2 channels. You can use the man command to view the manual page for aplay and see a full list of options that are available.

# man aplay

If you encounter the below error while running the aplay command:

aplay: command not found

you may try installing the below package as per your choice of distribution:

OS Distribution Command
Debian apt-get install alsa-utils
Ubuntu apt-get install alsa-utils
Alpine apk add alsa-utils
Arch Linux pacman -S alsa-utils
Kali Linux apt-get install alsa-utils
CentOS yum install alsa-utils
Fedora dnf install alsa-utils
Raspbian apt-get install alsa-utils

aplay Command Examples

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

# aplay {{path/to/file}}

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

# aplay --duration={{10}} --rate={{2500}} {{path/to/file}}

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

# aplay --channels={{1}} --file-type {{raw}} --rate={{22050}} --format={{mu_law}} {{path/to/file}}

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to merge 2 volume groups (VGs) into one using vgmerge in LVM
  2. apport-bug Command Examples in Linux
  3. josm Command Examples
  4. masscan Command Examples
  5. Working with Vim editor (Text Editor)
  6. How to Increase the File Download Size Limit in Apache
  7. git authors: Generate a list of committers of a Git repository
  8. beep Command Examples in Linux
  9. hsw-cli Command Examples
  10. CentOS / RHEL : How to set up chroot jail SFTP

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright