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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. kscreen-doctor : command not found
  2. How to Install and Configure Device Mapper Multipath in CentOS/RHEL 6,7
  3. nova Command Examples in Linux
  4. RHEL 7 – RHCSA Notes – vi/vim editor
  5. Reducing/Limiting the CPUs in CentOS/RHEL 5,6
  6. sort: command not found
  7. Complete Guide to Configuring iSCSI in CentOS / RHEL 7
  8. How to create and mount Btrfs file system (explained with examples)
  9. mount Command Examples in Linux
  10. How to create and mount filesystems in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright