Linux command
aplay 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Play
aplay [path/to/file]
Example
aplay -d 10 -r 2500 [path/to/file]
Example
aplay -c 1 -t raw -r 22050 -f mu_law [path/to/file]
Example
aplay -l
说明
aplay is a command-line sound player for ALSA soundcard drivers. It supports various audio formats and can automatically determine sampling rate, bit depth, and other parameters from the file format.
参数
- -d, --duration seconds
- Stop playback after the specified number of seconds
- -r, --rate rate
- Sampling rate in Hz
- -c, --channels count
- Number of channels (1 for mono, 2 for stereo)
- -t, --file-type type
- File type (voc, wav, raw, au)
- -f, --format format
- Sample format (S16_LE, U8, mu_law, etc.)
- -l, --list-devices
- List all available audio devices
- -L, --list-pcms
- List all PCM devices
- -D, --device name
- Select PCM device by name
- -q, --quiet
- Quiet mode; suppress messages
- -v, --verbose
- Verbose mode; show PCM structure and setup
- -i, --interactive
- Allow interactive operation via stdin (pause/resume with space or enter key)
FAQ
What is the aplay command used for?
aplay is a command-line sound player for ALSA soundcard drivers. It supports various audio formats and can automatically determine sampling rate, bit depth, and other parameters from the file format.
How do I run a basic aplay example?
Run `aplay [path/to/file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -d, --duration seconds do in aplay?
Stop playback after the specified number of seconds