Go to the documentation of this file.
27 #ifndef ASYNC_AUDIO_RECORDER_INCLUDED
28 #define ASYNC_AUDIO_RECORDER_INCLUDED
39 #include <sigc++/sigc++.h>
132 int sample_rate=INTERNAL_SAMPLE_RATE);
187 const struct timeval &
beginTimestamp(
void)
const {
return begin_timestamp; }
193 const struct timeval &
endTimestamp(
void)
const {
return end_timestamp; }
206 virtual int writeSamples(
const float *samples,
int count);
226 std::string
errorMsg(
void)
const {
return errmsg; }
249 std::string filename;
251 unsigned samples_written;
254 unsigned max_samples;
255 unsigned high_water_mark;
256 bool high_water_mark_reached;
257 struct timeval begin_timestamp;
258 struct timeval end_timestamp;
263 bool writeWaveHeader(
void);
264 int store32bitValue(
char *ptr, uint32_t val);
265 int store16bitValue(
char *ptr, uint16_t val);
266 void setErrMsgFromErrno(
const std::string &fname);
virtual int writeSamples(const float *samples, int count)
Write samples into this audio sink.
sigc::signal< void > errorOccurred
This signal is emitted when an error occurrs in the recorder.
A class for recording raw audio to a file.
const struct timeval & endTimestamp(void) const
The timestamp of the last stored sample.
bool closeFile(void)
Close the file.
void setMaxRecordingTime(unsigned time_ms, unsigned hw_time_ms=0)
Set the maximum length of this recording.
sigc::signal< void > maxRecordingTimeReached
A signal that's emitted when the max recording time is reached.
The base class for an audio sink.
~AudioRecorder(void)
Destructor.
bool initialize(void)
Initialize the recorder.
AudioRecorder(const std::string &filename, AudioRecorder::Format fmt=FMT_AUTO, int sample_rate=INTERNAL_SAMPLE_RATE)
Default constuctor.
Namespace for the asynchronous programming classes.
This file contains the base class for an audio sink.
std::string errorMsg(void) const
Return the current error message.
virtual void flushSamples(void)
Tell the sink to flush the previously written samples.
unsigned samplesWritten(void) const
Find out how many samples that have been written so far.
const struct timeval & beginTimestamp(void) const
The timestamp of the first stored sample.