Async 1.7.0
AsyncAudioContainerPcm.h
Go to the documentation of this file.
1
26
30
31#ifndef ASYNC_AUDIO_CONTAINER_PCM_INCLUDED
32#define ASYNC_AUDIO_CONTAINER_PCM_INCLUDED
33
34
35/****************************************************************************
36 *
37 * System Includes
38 *
39 ****************************************************************************/
40
41#include <vector>
42
43
44/****************************************************************************
45 *
46 * Project Includes
47 *
48 ****************************************************************************/
49
50#include <AsyncAudioContainer.h>
51
52
53/****************************************************************************
54 *
55 * Local Includes
56 *
57 ****************************************************************************/
58
59
60
61/****************************************************************************
62 *
63 * Forward declarations
64 *
65 ****************************************************************************/
66
67
68
69/****************************************************************************
70 *
71 * Namespace
72 *
73 ****************************************************************************/
74
75namespace Async
76{
77
78
79/****************************************************************************
80 *
81 * Forward declarations of classes inside of the declared namespace
82 *
83 ****************************************************************************/
84
85
86
87/****************************************************************************
88 *
89 * Defines & typedefs
90 *
91 ****************************************************************************/
92
93
94
95/****************************************************************************
96 *
97 * Exported Global Variables
98 *
99 ****************************************************************************/
100
101
102
103/****************************************************************************
104 *
105 * Class definitions
106 *
107 ****************************************************************************/
108
126{
127 public:
129 static constexpr const char *OBJNAME = "vnd.svxlink.pcm";
130
135
139 virtual ~AudioContainerPcm(void);
140
145 virtual const char* mediaType(void) const
146 {
147 return "audio/vnd.svxlink.pcm";
148 }
149
154 virtual const char* filenameExtension(void) const { return "raw"; }
155
166 virtual int writeSamples(const float *samples, int count);
167
175 virtual void flushSamples(void);
176
177 private:
178 size_t m_block_size = INTERNAL_SAMPLE_RATE / 10;
179 std::vector<int16_t> m_block;
180
182 AudioContainerPcm& operator=(const AudioContainerPcm&);
183
184}; /* class AudioContainerPcm */
185
186
187} /* namespace */
188
189#endif /* ASYNC_AUDIO_CONTAINER_PCM_INCLUDED */
190
191/*
192 * This file has not been truncated
193 */
Base class for audio container handlers.
static constexpr const char * OBJNAME
The name of this class when used by the object factory.
virtual const char * filenameExtension(void) const
Get the standard filename extension for the audio container.
virtual ~AudioContainerPcm(void)
Destructor.
virtual void flushSamples(void)
Tell the sink to flush the previously written samples.
virtual int writeSamples(const float *samples, int count)
Write samples into this audio sink.
AudioContainerPcm(void)
Default constructor.
virtual const char * mediaType(void) const
Retrieve the media type for the audio container.
AudioContainer(void)
Default constructor.
Namespace for the asynchronous programming classes.