libao documentation

libao version 1.1.0 - 20110221

ao_sample_format

declared in "ao/ao.h";

This structure describes the format of audio samples.

typedef struct {
  int  bits; /* bits per sample */
  int  rate; /* samples per second (in a single channel) */
  int  channels; /* number of audio channels */
  int  byte_format; /* Byte ordering in sample, see constants below */
  char *matrix; /* channel input matrix */
} ao_sample_format;

Relevant Struct Members

byte_format
Specifies the ordering of the sample bytes. The value of this member is ignored when samples have only 8 bits. Use the following constants:
matrix
Specifies the mapping of input channels to intended speaker/ouput location (or NULL to specify no mapping). The matrix is specified as a comma seperated list of channel locations equal to the number and in the order of the input channels. The channel mnemonics are as follows:

Note that the 'surround' speakers referred to in other systems can be either the side or back speakers depending on vendor. For example, Apple calls the back speakers 'surround' and the side speakers 'direct surround'. Dolby calls the back speakers 'surround rear' and the side speakers 'surround', resulting in a direct naming conflict. For this reason, libao explicitly refers to speakers as 'back' and 'side' rather than 'surround'.

Common examples of channel orderings:

Channel mappings for most formats are usually not tied to a single channel matrix (there are a few exceptions like Vorbis I, where the number of channels always maps to a specific order); the above examples cannot be blindly applied to a given file type and number of channels. The mapping must usually be read or intuited from the input.




copyright © 2001-2003 Stan Seibert, 2010-2011 Monty

xiph.org
monty@xiph.org

libao documentation

libao version 1.1.0 - 20110221