Go to the documentation of this file.
36 #ifndef ASYNC_AUDIO_IO_INCLUDED
37 #define ASYNC_AUDIO_IO_INCLUDED
275 Mode mode(
void)
const {
return io_mode; }
292 float gain(
void)
const {
return m_gain; }
298 int sampleRate(
void)
const {
return sample_rate; }
304 int channel(
void)
const {
return m_channel; }
348 class DelayedFlushAudioReader;
356 InputFifo *input_fifo;
357 DelayedFlushAudioReader *audio_reader;
361 AudioDevice *device(
void)
const {
return audio_dev; }
362 int readSamples(
float *samples,
int count);
363 bool doFlush(
void)
const;
364 bool isIdle(
void)
const;
365 int audioRead(
float *samples,
int count);
366 unsigned samplesAvailable(
void);
int sampleRate(void) const
Return the sample rate.
static void setSampleRate(int rate)
Set the sample rate used when doing future opens.
Contains a single shot or periodic timer that emits a signal on timeout.
int channel(void) const
Return the audio channel used.
Base class for handling audio devices.
Mode
The different modes to open a device in.
Implements a "valve" for audio.
AudioIO(const std::string &dev_name, int channel)
Constructor.
void allSamplesFlushed(void)
The registered sink has flushed all samples.
float gain(void) const
Return the gain.
static void setBlocksize(int size)
Set the blocksize used when opening audio devices.
Contains a watch for file descriptors.
The base class for an audio source.
void setGain(float gain)
Set the gain to use.
@ MODE_RDWR
Both read and write.
static void setBlockCount(int count)
Set the block count used when opening audio devices.
@ MODE_NONE
No mode. The same as close.
The base class for an audio sink.
void resumeOutput(void)
Resume audio output to the sink.
static void setChannels(int channels)
Set the number of channels used when doing future opens.
int readBlocksize(void)
Find out what the read (recording) blocksize is set to.
void close(void)
Close the adio device.
virtual void flushSamples(void)
Tell the sink to flush the previously written samples.
Namespace for the asynchronous programming classes.
virtual int writeSamples(const float *samples, int count)
Write samples into this audio sink.
This file contains the base class for an audio sink.
~AudioIO(void)
Destructor.
bool open(Mode mode)
Open the audio device in the specified mode.
This file contains the base class for an audio source.
int writeBlocksize(void)
Find out what the write (playback) blocksize is set to.
bool isFullDuplexCapable(void)
Check if the audio device is capable of full duplex operation.
Mode mode(void) const
Find out how many samples there are in the output buffer.