31#ifndef ASYNC_AUDIO_CONTAINER_WAV_INCLUDED
32#define ASYNC_AUDIO_CONTAINER_WAV_INCLUDED
41#include <sigc++/sigc++.h>
149 virtual const char*
mediaType(
void)
const {
return "audio/wav"; }
196 virtual size_t headerSize(
void)
const {
return WAVE_HEADER_SIZE; }
210 static const size_t WAVE_HEADER_SIZE = 44;
211 static const size_t NUM_CHANNELS = 1;
213 char m_wave_header[WAVE_HEADER_SIZE];
214 int m_sample_rate = INTERNAL_SAMPLE_RATE;
215 size_t m_samples_written = 0;
216 size_t m_block_size =
sizeof(int16_t)*INTERNAL_SAMPLE_RATE / 10;
217 char* m_block =
nullptr;
218 char* m_block_ptr =
nullptr;
219 bool m_realtime =
false;
224 size_t storeBuf(
char *ptr,
const char* buf,
size_t len)
226 std::memcpy(ptr, buf, len);
230 size_t store32bitValue(
char *ptr, uint32_t val)
242 size_t store16bitValue(
char *ptr, uint16_t val)
Base class for audio container handlers.
virtual const char * mediaType(void) const
Retrieve the media type for the audio container.
static constexpr const char * OBJNAME
The name of this class when used by the object factory.
virtual void setRealtime(void)
Indicate to the container that realtime operation is desired.
virtual int writeSamples(const float *samples, int count)
Write samples into this audio sink.
virtual ~AudioContainerWav(void)
Destructor.
virtual const char * filenameExtension(void) const
Get the standard filename extension for the audio container.
virtual void flushSamples(void)
Tell the sink to flush the previously written samples.
virtual const char * header(void)
Get the header data.
virtual size_t headerSize(void) const
Get the size of the header for this container.
AudioContainerWav(void)
Default constructor.
Namespace for the asynchronous programming classes.