Audio File Play.

      afplay [option...] audio_file

Options: (may appear before or after arguments)
   -v VOLUME
   --volume VOLUME
        Set the volume for playback of the file
        Apple does not define a value range for this, but it appears to accept
        0=silent, 1=normal (default) and then up to 255=Very loud.
        The scale is logarithmic and in addition to (not a replacement for) other volume control(s).
        Print help.

        Run leaks analysis.

   -t TIME
   --time TIME
        Play for TIME seconds
        >0 and < duration of audio_file.

   -r RATE
   --rate RATE
        Play at playback RATE.
        practical limits are about 0.4 (slower) to 3.0 (faster).

   --rQuality QUALITY
        Set the quality used for rate-scaled playback (default is 0 - low quality, 1 - high quality).

        Debug print output.

Play can be cancelled with Ctrl-C


Play music.wav for 5 seconds:
$ afplay music.wav -t 5

Play jolene.mp3:
$ afplay jolene.mp3

Play jolene.mp3 at half speed:
$ afplay jolene.mp3 -r 0.5

“You've achieved success in your field when you don't know whether what you're doing is work or play” ~ Warren Beatty

Related macOS commands

Local man page: afplay - Command line help page on your local machine.
afconvert - Audio File Convert.
afinfo - Audio File Info.

Copyright © 1999-2024
Some rights reserved