Async 1.8.0
AsyncAudioContainerPcm.h
Go to the documentation of this file.
1
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#include <cstdint>
43
44
45/****************************************************************************
46 *
47 * Project Includes
48 *
49 ****************************************************************************/
50
51#include <AsyncAudioContainer.h>
52
53
54/****************************************************************************
55 *
56 * Local Includes
57 *
58 ****************************************************************************/
59
60
61
62/****************************************************************************
63 *
64 * Forward declarations
65 *
66 ****************************************************************************/
67
68
69
70/****************************************************************************
71 *
72 * Namespace
73 *
74 ****************************************************************************/
75
76namespace Async
77{
78
79
80/****************************************************************************
81 *
82 * Forward declarations of classes inside of the declared namespace
83 *
84 ****************************************************************************/
85
86
87
88/****************************************************************************
89 *
90 * Defines & typedefs
91 *
92 ****************************************************************************/
93
94
95
96/****************************************************************************
97 *
98 * Exported Global Variables
99 *
100 ****************************************************************************/
101
102
103
104/****************************************************************************
105 *
106 * Class definitions
107 *
108 ****************************************************************************/
109
127{
128 public:
130 static constexpr const char *OBJNAME = "vnd.svxlink.pcm";
131
136
140 virtual ~AudioContainerPcm(void);
141
146 virtual const char* mediaType(void) const
147 {
148 return "audio/vnd.svxlink.pcm";
149 }
150
155 virtual const char* filenameExtension(void) const { return "raw"; }
156
167 virtual int writeSamples(const float *samples, int count);
168
176 virtual void flushSamples(void);
177
178 private:
179 size_t m_block_size = INTERNAL_SAMPLE_RATE / 10;
180 std::vector<int16_t> m_block;
181
183 AudioContainerPcm& operator=(const AudioContainerPcm&);
184
185}; /* class AudioContainerPcm */
186
187
188} /* namespace */
189
190#endif /* ASYNC_AUDIO_CONTAINER_PCM_INCLUDED */
191
192/*
193 * This file has not been truncated
194 */
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.
Namespace for the asynchronous programming classes.