Async::AudioRecorder Class Reference

A class for recording raw audio to a file. More...

#include <AsyncAudioRecorder.h>

Inheritance diagram for Async::AudioRecorder:
Async::AudioSink

List of all members.

Public Types

Public Member Functions


Detailed Description

A class for recording raw audio to a file.

Author:
Tobias Blomberg / SM0SVX
Date:
2005-08-29

Use this class to stream audio into a file. The audio is stored in raw format, only samples no header.

Definition at line 118 of file AsyncAudioRecorder.h.


Member Enumeration Documentation

Enumerator:
FMT_RAW 
FMT_WAV 

Definition at line 121 of file AsyncAudioRecorder.h.


Constructor & Destructor Documentation

Async::AudioRecorder::AudioRecorder ( const std::string &  filename,
AudioRecorder::Format  format = FMT_RAW,
int  sample_rate = 0 
) [explicit]

Default constuctor.

Parameters:
filename The name of the file to record audio to
format The file format (
See also:
Format)
Parameters:
sample_rate The sample rate (only needed for format != FMT_RAW)
Async::AudioRecorder::~AudioRecorder ( void   ) 

Destructor.


Member Function Documentation

virtual void Async::AudioRecorder::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. This function is normally only called from a connected source object.

Reimplemented from Async::AudioSink.

bool Async::AudioRecorder::initialize ( void   ) 

Initialize the recorder.

Returns:
Return true if the initialization was successful
virtual int Async::AudioRecorder::writeSamples ( const float *  samples,
int  count 
) [virtual]

Write samples into this audio sink.

Parameters:
samples The buffer containing the samples
count The 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:
Generated by  doxygen 1.6.2-20100208