36#ifndef ASYNC_AUDIO_IO_INCLUDED
37#define ASYNC_AUDIO_IO_INCLUDED
292 float gain(
void)
const {
return m_gain; }
304 size_t 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);
This file contains the base class for an audio sink.
This file contains the base class for an audio source.
Contains a watch for file descriptors.
Contains a single shot or periodic timer that emits a signal on timeout.
Base class for handling audio devices.
A class for handling audio input/output to an audio device.
static void setBlocksize(size_t size)
Set the blocksize used when opening audio devices.
size_t readBlocksize(void)
Find out what the read (recording) blocksize is set to.
bool isFullDuplexCapable(void)
Check if the audio device is capable of full duplex operation.
float gain(void) const
Return the gain.
static void setBlockCount(size_t count)
Set the block count used when opening audio devices.
size_t writeBlocksize(void)
Find out what the write (playback) blocksize is set to.
bool open(Mode mode)
Open the audio device in the specified mode.
int sampleRate(void) const
Return the sample rate.
static void setChannels(size_t channels)
Set the number of channels used when doing future opens.
void resumeOutput(void)
Resume audio output to the sink.
~AudioIO(void)
Destructor.
size_t channel(void) const
Return the audio channel used.
Mode
The different modes to open a device in.
@ MODE_NONE
No mode. The same as close.
@ MODE_RDWR
Both read and write.
void close(void)
Close the adio device.
AudioIO(const std::string &dev_name, size_t channel)
Constructor.
void setGain(float gain)
Set the gain to use.
Mode mode(void) const
Find out how many samples there are in the output buffer.
static void setSampleRate(int rate)
Set the sample rate used when doing future opens.
void allSamplesFlushed(void)
The registered sink has flushed all samples.
The base class for an audio sink.
virtual int writeSamples(const float *samples, int count)
Write samples into this audio sink.
virtual void flushSamples(void)
Tell the sink to flush the previously written samples.
The base class for an audio source.
Implements a "valve" for audio.
Namespace for the asynchronous programming classes.