Async 1.8.0
Async::AudioReader Class Reference

An audio pipe component for on demand reading samples. More...

#include <AsyncAudioReader.h>

Inheritance diagram for Async::AudioReader:
Async::AudioSink

Public Member Functions

 AudioReader (void)
 Default constuctor.
 
 ~AudioReader (void)
 Destructor.
 
int readSamples (float *samples, int count)
 Read at most the specified number of samples.
 
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.
 
- Public Member Functions inherited from Async::AudioSink
 AudioSink (void)
 Default constuctor.
 
virtual ~AudioSink (void)
 Destructor.
 
bool registerSource (AudioSource *source)
 Register an audio source to provide samples to this sink.
 
void unregisterSource (void)
 Unregister the previously registered audio source.
 
bool isRegistered (void) const
 Check if an audio source has been registered.
 
AudioSourcesource (void) const
 Get the registered audio source.
 

Additional Inherited Members

- Protected Member Functions inherited from Async::AudioSink
void sourceResumeOutput (void)
 Tell the source that we are ready to accept more samples.
 
void sourceAllSamplesFlushed (void)
 Tell the source that all samples have been flushed.
 
bool setHandler (AudioSink *handler)
 Setup another sink to handle the incoming audio.
 
void clearHandler (void)
 Clear a handler that was previously setup with setHandler.
 
AudioSinkhandler (void) const
 

Detailed Description

An audio pipe component for on demand reading samples.

Author
Tobias Blomberg / SM0SVX
Date
2008-02-22

This audio pipe component is used when reading samples on demand is preferred rather than getting them pushed at you.

Definition at line 112 of file AsyncAudioReader.h.

Constructor & Destructor Documentation

◆ AudioReader()

Async::AudioReader::AudioReader ( void )

Default constuctor.

◆ ~AudioReader()

Async::AudioReader::~AudioReader ( void )

Destructor.

Member Function Documentation

◆ flushSamples()

virtual void Async::AudioReader::flushSamples ( void )
virtual

Tell the sink to flush the previously written samples.

This function is used to tell the sink to flush previously written samples. When done flushing, the sourceAllSamplesFlushed function will be called. This function is normally only called from a connected source object.

Reimplemented from Async::AudioSink.

◆ readSamples()

int Async::AudioReader::readSamples ( float * samples,
int count )

Read at most the specified number of samples.

Parameters
samplesA buffer to put the read samples into
countThe maximum number of samples to read. This value must not be larger than the size of the "samples" buffer given in the first argument.
Returns
Returns the number of samples actually read

◆ writeSamples()

virtual int Async::AudioReader::writeSamples ( const float * samples,
int count )
virtual

Write samples into this audio sink.

Parameters
samplesThe buffer containing the samples
countThe number of samples in the buffer
Returns
Returns the number of samples that has been taken care of

This function is used to write audio into this audio sink. If it returns 0, no more samples should be written until the resumeOutput function in the source have been called. This function is normally only called from a connected source object.

Reimplemented from Async::AudioSink.


The documentation for this class was generated from the following file: