forsyth20121205-174063a80cc13 years agoHistory
79 lines · 1.6 KB · Text
RawDownload
.TH AUDIO 6.SH NAMEaudio \- Inferno audio file format.SH DESCRIPTIONInferno audio files accepted by commands such as.IR auplay (1)have a simple format.The file contains a header consisting ofnon-empty lines of text specifying the data format and characteristics,followed by an empty line,followed by the audio data in binary form.The data can be copieddirectly to a suitable audio device (see.IR audio (3))correctly configured,using.BR read ,.B writeor.B stream(see.IR sys-read (2))..PPEach header line corresponds to a command that can be written tothe control file.B audioctlof the.IR audio (3)device.The first line of the header must be a.BR ratecommand;other commands can appear in any order.The commands available are:.TP.BI rate " n"The data was recorded at.I nHz, typically one of.BR 44100 ,.BR 22050 ,.BR 11025or.BR 8000but other values are legal..TP.BI chans " n"There are.I nchannels of audio data (eg, 1 for mono and 2 for stereo)..TP.BI bits " n"Each sample is.I nbits (typically 8 or 16)..TP.BI enc " e".brThe string.I egives the recording format, andwill usually be one of the following:.BR ulaw ,.BR alaw ,.BR pcmor.BR adpcm ..PPThe audio data is stored with a sample from each channel in turn(`left' sample first if stereo, regardless of encoding or data size).Data encoded as.B pcmis little-endian, 2's complement  if 16-bit, but unsigned if 8 bit.The.B adpcmencoding uses 4-bit samples (two mono samples or one stereo sample per byte, again little-endian)..SH SEE ALSO.IR auplay (1),.IR audio (3)