using namespace std;
{
public:
MyClass(void)
{
audio_io =
new AudioIO(
"alsa:default", 0);
audio_io->open(AudioIO::MODE_RDWR);
audio_io->registerSource(this);
sine_gen->setPower(-24);
sine_io->
open(AudioIO::MODE_WR);
sine_gen->registerSink(sine_io, true);
sine_gen->enable(true);
}
~MyClass(void)
{
delete audio_io;
delete sine_gen;
}
{
}
{
}
{
}
{
}
private:
};
int main(int argc, char **argv)
{
MyClass my_class;
}
Contains a class for handling audio input/output to an audio device.
This file contains the base class for an audio sink.
This file contains the base class for an audio source.
The core class for writing asyncronous cpp applications.
A class for generating periodic audio signals.
void setFq(float tone_fq)
Set the audio frequency.
A class for handling audio input/output to an audio device.
bool open(Mode mode)
Open the audio device in the specified mode.
The base class for an audio sink.
void sourceAllSamplesFlushed(void)
Tell the source that all samples have been flushed.
bool registerSource(AudioSource *source)
Register an audio source to provide samples to this sink.
virtual int writeSamples(const float *samples, int count)
Write samples into this audio sink.
void sourceResumeOutput(void)
Tell the source that we are ready to accept more samples.
virtual void flushSamples(void)
Tell the sink to flush the previously written samples.
The base class for an audio source.
virtual void allSamplesFlushed(void)
The registered sink has flushed all samples.
void sinkFlushSamples(void)
virtual void resumeOutput(void)
Resume audio output to the sink.
int sinkWriteSamples(const float *samples, int len)
An application class for writing non GUI applications.
void exec(void)
Execute the application main loop.
Namespace for the asynchronous programming classes.