#include <audio2.h>
Public Member Functions | |
virtual | ~AudioDevice () |
virtual unsigned | putSamples (Linear buffer, unsigned count)=0 |
Copy linear samples to an audio device through its virtual. | |
virtual unsigned | getSamples (Linear buffer, unsigned count)=0 |
Copy linear samples from an audio device through its virtual. | |
virtual ssize_t | putBuffer (Encoded data, size_t count) |
Copy audio encoded in the currently selected encoding for the audio device. | |
virtual ssize_t | getBuffer (Encoded data, size_t count) |
Record audio encoded in the currently selected encoding for the audio device. | |
virtual bool | setEncoded (Info &info) |
Use encoding source descriptor to select the audio encoding format the audio device should be using. | |
virtual bool | setAudio (Rate rate=rate8khz, bool stereo=false, timeout_t framing=20)=0 |
Set properties for audio device. | |
virtual void | sync (void) |
Synchronize timing for audio device to next audio frame. | |
virtual void | flush (void)=0 |
Flush any pending buffered samples in audio device. | |
unsigned | bufMono (Linear buffer, unsigned count) |
Process linear mono audio and automatically convert to the encoding format the audio device is currently using. | |
unsigned | bufStereo (Linear buffer, unsigned count) |
Process linear stereo audio and automatically convert to the encoding format the audio device is currently using. | |
Info * | getInfo (void) |
Get audio device source descriptor in effect for the device. | |
bool | isEnabled (void) |
Whether device is currently enabled. | |
Protected Attributes | |
bool | enabled |
virtual ost::AudioDevice::~AudioDevice | ( | ) | [inline, virtual] |
virtual unsigned ost::AudioDevice::putSamples | ( | Linear | buffer, | |
unsigned | count | |||
) | [pure virtual] |
Copy linear samples to an audio device through its virtual.
buffer | to linear audio data to play. | |
count | of audio samples to play. |
virtual unsigned ost::AudioDevice::getSamples | ( | Linear | buffer, | |
unsigned | count | |||
) | [pure virtual] |
Copy linear samples from an audio device through its virtual.
buffer | for recording. | |
count | of audio samples to record. |
virtual ssize_t ost::AudioDevice::putBuffer | ( | Encoded | data, | |
size_t | count | |||
) | [virtual] |
Copy audio encoded in the currently selected encoding for the audio device.
data | pointer to encoded data to play. | |
count | of encoded bytes to play. |
Implements ost::AudioBase.
virtual ssize_t ost::AudioDevice::getBuffer | ( | Encoded | data, | |
size_t | count | |||
) | [virtual] |
Record audio encoded in the currently selected encoding for the audio device.
data | buffer for recording encoded audio. | |
count | of encoded bytes to record. |
Implements ost::AudioBase.
virtual bool ost::AudioDevice::setEncoded | ( | Info & | info | ) | [inline, virtual] |
Use encoding source descriptor to select the audio encoding format the audio device should be using.
info | source description for device settings. |
virtual bool ost::AudioDevice::setAudio | ( | Rate | rate = rate8khz , |
|
bool | stereo = false , |
|||
timeout_t | framing = 20 | |||
) | [pure virtual] |
Set properties for audio device.
rate | of audio samples device should operate at. | |
stereo | flag. | |
framing | timer for default i/o framing for device. |
virtual void ost::AudioDevice::sync | ( | void | ) | [inline, virtual] |
Synchronize timing for audio device to next audio frame.
this is needed for audio devices which do not block i/o to assure one does not push too much data before the device can handle it.
virtual void ost::AudioDevice::flush | ( | void | ) | [pure virtual] |
Flush any pending buffered samples in audio device.
unsigned ost::AudioDevice::bufMono | ( | Linear | buffer, | |
unsigned | count | |||
) |
Process linear mono audio and automatically convert to the encoding format the audio device is currently using.
If needed, automatically convert from mono to stereo.
buffer | to linear mono audio data to play. | |
count | of linear mono audio samples to play. |
unsigned ost::AudioDevice::bufStereo | ( | Linear | buffer, | |
unsigned | count | |||
) |
Process linear stereo audio and automatically convert to the encoding format the audio device is currently using.
If needed, automatically convert from stereo to mono.
buffer | to linear stereo audio data to play. | |
count | of linear stereo audio samples to play. |
Info* ost::AudioDevice::getInfo | ( | void | ) | [inline] |
Get audio device source descriptor in effect for the device.
bool ost::AudioDevice::isEnabled | ( | void | ) | [inline] |
Whether device is currently enabled.
If invalid audio settings are selected, it will be disabled until supported values are supplied.
bool ost::AudioDevice::enabled [protected] |