Async 1.8.0
Async::AudioContainerWav Class Reference

#include <AsyncAudioContainerWav.h>

Inheritance diagram for Async::AudioContainerWav:
Async::AudioContainer Async::AudioSink

Public Member Functions

 AudioContainerWav (void)
 Default constructor.
 
virtual ~AudioContainerWav (void)
 Destructor.
 
virtual const char * mediaType (void) const
 Retrieve the media type for the audio container.
 
virtual const char * filenameExtension (void) const
 Get the standard filename extension for the audio container.
 
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.
 
virtual void setRealtime (void)
 Indicate to the container that realtime operation is desired.
 
virtual size_t headerSize (void) const
 Get the size of the header for this container.
 
virtual const char * header (void)
 Get the header data.
 
- Public Member Functions inherited from Async::AudioContainer
 AudioContainer (void)
 Default constructor.
 
 AudioContainer (const AudioContainer &)=delete
 Disable copy constructor.
 
AudioContaineroperator= (const AudioContainer &)=delete
 Disable assignment operator.
 
virtual ~AudioContainer (void)
 Destructor.
 
virtual void endStream (void)
 Indicate to the container that the stream has ended.
 
- 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.
 

Static Public Attributes

static constexpr const char * OBJNAME = "wav"
 The name of this class when used by the object factory.
 

Additional Inherited Members

- Public Attributes inherited from Async::AudioContainer
sigc::signal< void, const char *, size_t > writeBlock
 A signal that is emitted when a block is ready to be written.
 
- 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

Definition at line 124 of file AsyncAudioContainerWav.h.

Constructor & Destructor Documentation

◆ AudioContainerWav()

Async::AudioContainerWav::AudioContainerWav ( void )

Default constructor.

◆ ~AudioContainerWav()

virtual Async::AudioContainerWav::~AudioContainerWav ( void )
virtual

Destructor.

Member Function Documentation

◆ filenameExtension()

virtual const char * Async::AudioContainerWav::filenameExtension ( void ) const
inlinevirtual

Get the standard filename extension for the audio container.

Returns
Returns a string containing the filename extention, e.g. wav

Implements Async::AudioContainer.

Definition at line 155 of file AsyncAudioContainerWav.h.

◆ flushSamples()

virtual void Async::AudioContainerWav::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 sink should call the sourceAllSamplesFlushed function.

Reimplemented from Async::AudioSink.

◆ header()

virtual const char * Async::AudioContainerWav::header ( void )
virtual

Get the header data.

Returns
Return a pointer to the header data

This function is normally called as the last thing before closing a file in order to write the header to the beginning of the file. This of course requires that space have been reserved as described in the documentation for the headerSize function.

Reimplemented from Async::AudioContainer.

◆ headerSize()

virtual size_t Async::AudioContainerWav::headerSize ( void ) const
inlinevirtual

Get the size of the header for this container.

Returns
Returns the size of the header

This function is normally called directly after opening a file to reserve space for writing the header later, usually as the last thing before closing the file.

Reimplemented from Async::AudioContainer.

Definition at line 196 of file AsyncAudioContainerWav.h.

◆ mediaType()

virtual const char * Async::AudioContainerWav::mediaType ( void ) const
inlinevirtual

Retrieve the media type for the audio container.

Returns
Returns a string representing the media type, e.g. audio/wav

Implements Async::AudioContainer.

Definition at line 149 of file AsyncAudioContainerWav.h.

◆ setRealtime()

virtual void Async::AudioContainerWav::setRealtime ( void )
inlinevirtual

Indicate to the container that realtime operation is desired.

This function can be called to inidicate to the container that we are writing the audio to a realtime stream rather than to a file. The container can then choose to indicate this in the audio stream if it have that capability.

Reimplemented from Async::AudioContainer.

Definition at line 186 of file AsyncAudioContainerWav.h.

◆ writeSamples()

virtual int Async::AudioContainerWav::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.

Reimplemented from Async::AudioSink.

Member Data Documentation

◆ OBJNAME

const char* Async::AudioContainerWav::OBJNAME = "wav"
staticconstexpr

The name of this class when used by the object factory.

Definition at line 128 of file AsyncAudioContainerWav.h.


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