AudioDevice

Implements a universal interface to an audio device. Each driver inherits from this.

Members

Functions

createOutputStream
OutputStream createOutputStream()

Creates an OutputStream specific to the given driver/device, with the requested parameters, then returns it. Or null in case of an error, then it also sets errCode to a given error code. Might also set a separate error code variable, depending on the OS/backend.

requestSpecs
AudioSpecs requestSpecs(AudioSpecs reqSpecs, int flags)

Sets the device's audio specifications to the closest possible specifications.

Properties

nOfInputs
short nOfInputs [@property getter]

Returns the number of input channels this device has, or zero if there's none, or -1 if it's enforced at audio spec request. NOTE: Depending on the backend, devices' inputs and outputs (or even different inputs and outputs) might show up as different devices.

nOfOutputs
short nOfOutputs [@property getter]

Returns the number of output channels this device has, or zero if there's none, or -1 if it's enforced at audio spec request. NOTE: Depending on the backend, devices' inputs and outputs (or even different inputs and outputs) might show up as different devices.

sampleRateRange
int[] sampleRateRange [@property getter]

Returns the range of sample rates that this audio device supports. Might return null if it's enforced at audio spec request. NOTE: It is not guaranteed, that at all sample ranges, all formats will be available.

shareMode
AudioShareMode shareMode [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
specs
AudioSpecs specs [@property getter]

Returns the currently set audio specifications.

supportedFormats
SampleFormat[] supportedFormats [@property getter]

Returns the range of audio formats that this audio device supports. Might return null if it's enforced at audio spec request. NOTE: It is not guaranteed, that at all sample ranges, all formats will be available.

Variables

_nOfInputs
short _nOfInputs;

Number of input channels, or zero if there's none.

_nOfOutputs
short _nOfOutputs;

Number of output channels, or zero if there's none.

_sampleRateRange
int[] _sampleRateRange;

Stores either all supported sample rates, or two values of lowest and highest supported sample rates if any value can be set without stepping. NOTE: It is not guaranteed, that at all sample ranges, all formats will be available.

_shareMode
AudioShareMode _shareMode;

Tells whether the device is in shared or exclusive mode. In some cases, this can be set, in others it's either shared or exclusive.

_specs
AudioSpecs _specs;

The audio specifications set and available to this device.

_supportedFormats
SampleFormat[] _supportedFormats;

Stores supported formats.

callback_onDeviceDisconnect
void delegate() callback_onDeviceDisconnect;

Called when device is disconnected.

errCode
int errCode;

The last error code if there's any, or 0. Shall not be set externally, although should not impede on operation.

Meta