AudioDeviceHandler

Manages and initializes audio devices.

Important: Only one instance should be made.

Constructors

this
this(AudioSpecs specs, int blockSize, int nOfBlocks)

Creates an instance, and detects all drivers.

Destructor

~this
~this()

Destructor

Members

Functions

getBufferDelay
Duration getBufferDelay()

Returns the buffer length in time, in Duration format.

getBufferSize
size_t getBufferSize()

Returns the buffer size in units.

getChannels
int getChannels()

Returns the number of audio channels.

getDevices
string[] getDevices()

Return an array with the names of the available audio devices.

getSamplingFrequency
int getSamplingFrequency()

Returns the available sampling frequency.

initAudioDevice
void initAudioDevice(int id)

Opens a specific audio device for audio playback by ID, then sets the values for buffer sizes etc.

Static functions

initAudioDriver
void initAudioDriver(DriverType backend)

Initializes an audio driver by ID.

Variables

blockSize
int blockSize;

Requested/given buffer base size / block length (in samples)

device
AudioDevice device;

Contains the initialized audio device

nOfBlocks
int nOfBlocks;

Requested/given number of blocks before they get sent to the output

specs
AudioSpecs specs;

Contains the requested/given audio specs

Meta