1 AUDIOPLAY(1) User Commands AUDIOPLAY(1) 2 3 4 5 NAME 6 audioplay - play audio files 7 8 SYNOPSIS 9 audioplay [-iV] [-v vol] [-d dev] [file]... 10 11 12 DESCRIPTION 13 The audioplay utility copies the named audio files (or the standard 14 input if no filenames are present) to the audio device. If no input 15 file is specified and standard input is a tty, the program exits with 16 an error message. 17 18 19 The input files must contain a valid audio file header. The encoding 20 information in this header is matched against the capabilities of the 21 audio device and, if the data formats are incompatible, an error 22 message is printed and the file is skipped. Compressed ADPCM (G.721) 23 monaural audio data is automatically uncompressed before playing. 24 25 26 Minor deviations in sampling frequency (that is, less than 1%) are 27 ordinarily ignored. This allows, for instance, data sampled at 8012 Hz 28 to be played on an audio device that only supports 8000 Hz. If the -V 29 option is present, such deviations are flagged with warning messages. 30 31 OPTIONS 32 The following options are supported: 33 34 -d dev 35 Device: The dev argument specifies an alternate audio device 36 to which output should be directed. If the -d option is not 37 specified, the AUDIODEV environment variable is consulted 38 (see below). Otherwise, /dev/audio is used as the default 39 audio device. 40 41 42 -i 43 Immediate: If the audio device is unavailable (that is, 44 another process currently has write access), audioplay 45 ordinarily waits until it can obtain access to the device. 46 When the -i option is present, audioplay prints an error 47 message and exits immediately if the device is busy. 48 49 50 -v vol 51 Volume: The output volume is set to the specified value 52 before playing begins, and is reset to its previous level 53 when audioplay exits. The vol argument is an integer value 54 between 0 and 100, inclusive. If this argument is not 55 specified, the output volume remains at the level most 56 recently set by any process. 57 58 59 -V 60 Verbose: Prints messages on the standard error when waiting 61 for access to the audio device or when sample rate 62 deviations are detected. 63 64 65 -? 66 Help: Prints a command line usage message. 67 68 69 OPERANDS 70 file 71 File Specification: Audio files named on the command line are 72 played sequentially. If no filenames are present, the standard 73 input stream (if it is not a tty) is played (it, too, must 74 contain an audio file header). The special filename - can be 75 used to read the standard input stream instead of a file. If a 76 relative path name is supplied, the AUDIOPATH environment 77 variable is consulted (see below). 78 79 80 USAGE 81 See largefile(5) for the description of the behavior of audioplay when 82 encountering files greater than or equal to 2 Gbyte (2^31 bytes). 83 84 ENVIRONMENT VARIABLES 85 AUDIODEV 86 The full path name of the audio device to write to, if no 87 -d argument is supplied. If the AUDIODEV variable is not 88 set, /dev/audio is used. 89 90 91 AUDIOPATH 92 A colon-separated list of directories in which to search 93 for audio files whose names are given by relative 94 pathnames. The current directory (.) can be specified 95 explicitly in the search path. If the AUDIOPATH variable 96 is not set, only the current directory is searched. 97 98 99 SEE ALSO 100 audioconvert(1), audiorecord(1), largefile(5), audio(7I) 101 102 BUGS 103 audioplay currently supports a limited set of audio format conversions. 104 If the audio file is not in a format supported by the audio device, it 105 must first be converted. For example, to convert to voice format on the 106 fly, use the command: 107 108 example% audioconvert -f voice myfile | audioplay 109 110 111 112 113 The format conversion is not always be able to keep up with the audio 114 output. If this is the case, you should convert to a temporary file 115 before playing the data. 116 117 118 119 February 8, 2020 AUDIOPLAY(1)