The libao API makes a distinction between drivers and devices. A driver is a set of functions that allow audio to be played on a particular platform (i.e. Solaris, ESD, etc.). A device is a particular output target that uses a driver. In addition, libao distinguishes between live output drivers, which write audio to playback devices (sound cards, etc.), and file output drivers, which write audio to disk in a particular format.
-
Use AoDriver..::.Default to get a reference to the default output driver. This may not be successful if no audio hardware is available, it is in use, or is not in the "standard" configuration. If you want to specify a particular output driver, you may call AoDriver..::.FromName with a string corresponding to the short name of the device (i.e. oss, wav, etc.) instead.
-
If you are using the default device, no extra options are needed. However, if you wish to to pass special options to the driver, you will need to create a new AoDriverOptions object and add any driver-specific options you need by setting AoDriverOptions..::.Item[([(String])]). Note that the options take the form of key/value pairs where the supported keys are listed in the driver documentation.
-
Call AoDriver..::.OpenLive and save the returned device reference. If you are using a file output driver, you will need to call AoDriver..::.OpenFile instead.
-
Call AoDevice..::.Play to output each block of audio.