arduino-audio-tools
Loading...
Searching...
No Matches
AudioFormat.h
Go to the documentation of this file.
1
11#pragma once
12#include <cstring>
14
15namespace audio_tools {
16
21enum class AudioFormat : uint16_t {
22 UNKNOWN = 0x0000, /* Microsoft Corporation */
23 PCM = 0x0001,
24 ADPCM = 0x0002, /* Microsoft Corporation */
25 IEEE_FLOAT = 0x0003, /* Microsoft Corporation */
26 // VSELP = 0x0004, /* Compaq Computer Corp. */
27 // IBM_CVSD = 0x0005, /* IBM Corporation */
28 ALAW = 0x0006, /* Microsoft Corporation */
29 MULAW = 0x0007, /* Microsoft Corporation */
30 // DTS = 0x0008, /* Microsoft Corporation */
31 // DRM = 0x0009, /* Microsoft Corporation */
32 // WMAVOICE9 = 0x000A, /* Microsoft Corporation */
33 // WMAVOICE10 = 0x000B, /* Microsoft Corporation */
34 OKI_ADPCM = 0x0010, /* OKI */
35 DVI_ADPCM = 0x0011, /* Intel Corporation */
36 IMA_ADPCM = DVI_ADPCM, /* alias: same WAVE format tag as DVI_ADPCM */
37 MEDIASPACE_ADPCM = 0x0012, /* Videologic */
38 SIERRA_ADPCM = 0x0013, /* Sierra Semiconductor Corp */
39 G723_ADPCM = 0x0014, /* Antex Electronics Corporation */
40 // DIGISTD = 0x0015, /* DSP Solutions, Inc. */
41 // DIGIFIX = 0x0016, /* DSP Solutions, Inc. */
42 DIALOGIC_OKI_ADPCM = 0x0017, /* Dialogic Corporation */
43 MEDIAVISION_ADPCM = 0x0018, /* Media Vision, Inc. */
44 // CU_CODEC = 0x0019, /* Hewlett-Packard Company */
45 // HP_DYN_VOICE = 0x001A, /* Hewlett-Packard Company */
46 YAMAHA_ADPCM = 0x0020, /* Yamaha Corporation of America */
47 // SONARC = 0x0021, /* Speech Compression */
48 // DSPGROUP_TRUESPEECH = 0x0022, /* DSP Group, Inc */
49 // ECHOSC1 = 0x0023, /* Echo Speech Corporation */
50 // AUDIOFILE_AF36 = 0x0024, /* Virtual Music, Inc. */
51 // APTX = 0x0025, /* Audio Processing Technology */
52 // AUDIOFILE_AF10 = 0x0026, /* Virtual Music, Inc. */
53 // PROSODY_1612 = 0x0027, /* Aculab plc */
54 // LRC = 0x0028, /* Merging Technologies S.A. */
55 // DOLBY_AC2 = 0x0030, /* Dolby Laboratories */
56 // GSM610 = 0x0031, /* Microsoft Corporation */
57 // MSNAUDIO = 0x0032, /* Microsoft Corporation */
58 ANTEX_ADPCME = 0x0033, /* Antex Electronics Corporation */
59 // CONTROL_RES_VQLPC = 0x0034, /* Control Resources Limited */
60 // DIGIREAL = 0x0035, /* DSP Solutions, Inc. */
61 DIGIADPCM = 0x0036, /* DSP Solutions, Inc. */
62 // CONTROL_RES_CR10 = 0x0037, /* Control Resources Limited */
63 NMS_VBXADPCM = 0x0038, /* Natural MicroSystems */
64 CS_IMAADPCM = 0x0039, /* Crystal Semiconductor IMA ADPCM */
65 // ECHOSC3 = 0x003A, /* Echo Speech Corporation */
66 ROCKWELL_ADPCM = 0x003B, /* Rockwell International */
67 // ROCKWELL_DIGITALK = 0x003C, /* Rockwell International */
68 // XEBEC = 0x003D, /* Xebec Multimedia Solutions Limited */
69 G721_ADPCM = 0x0040, /* Antex Electronics Corporation */
70 // G728_CELP = 0x0041, /* Antex Electronics Corporation */
71 // MSG723 = 0x0042, /* Microsoft Corporation */
72 // INTEL_G723_1 = 0x0043, /* Intel Corp. */
73 // INTEL_G729 = 0x0044, /* Intel Corp. */
74 // SHARP_G726 = 0x0045, /* Sharp */
75 // MPEG = 0x0050, /* Microsoft Corporation */
76 // RT24 = 0x0052, /* InSoft, Inc. */
77 // PAC = 0x0053, /* InSoft, Inc. */
78 // MPEGLAYER3 = 0x0055, /* ISO/MPEG Layer3 Format Tag */
79 // LUCENT_G723 = 0x0059, /* Lucent Technologies */
80 // CIRRUS = 0x0060, /* Cirrus Logic */
81 // ESPCM = 0x0061, /* ESS Technology */
82 // VOXWARE = 0x0062, /* Voxware Inc */
83 // CANOPUS_ATRAC = 0x0063, /* Canopus, co., Ltd. */
84 G726_ADPCM = 0x0064, /* APICOM */
85 G722_ADPCM = 0x0065, /* APICOM */
86 // DSAT = 0x0066, /* Microsoft Corporation */
87 // DSAT_DISPLAY = 0x0067, /* Microsoft Corporation */
88 // VOXWARE_BYTE_ALIGNED = 0x0069, /* Voxware Inc */
89 // VOXWARE_AC8 = 0x0070, /* Voxware Inc */
90 // VOXWARE_AC10 = 0x0071, /* Voxware Inc */
91 // VOXWARE_AC16 = 0x0072, /* Voxware Inc */
92 // VOXWARE_AC20 = 0x0073, /* Voxware Inc */
93 // VOXWARE_RT24 = 0x0074, /* Voxware Inc */
94 // VOXWARE_RT29 = 0x0075, /* Voxware Inc */
95 // VOXWARE_RT29HW = 0x0076, /* Voxware Inc */
96 // VOXWARE_VR12 = 0x0077, /* Voxware Inc */
97 // VOXWARE_VR18 = 0x0078, /* Voxware Inc */
98 // VOXWARE_TQ40 = 0x0079, /* Voxware Inc */
99 // VOXWARE_SC3 = 0x007A, /* Voxware Inc */
100 // VOXWARE_SC3_1 = 0x007B, /* Voxware Inc */
101 // SOFTSOUND = 0x0080, /* Softsound, Ltd. */
102 // VOXWARE_TQ60 = 0x0081, /* Voxware Inc */
103 // MSRT24 = 0x0082, /* Microsoft Corporation */
104 // G729A = 0x0083, /* AT&T Labs, Inc. */
105 // MVI_MVI2 = 0x0084, /* Motion Pixels */
106 // DF_G726 = 0x0085, /* DataFusion Systems (Pty) (Ltd) */
107 // DF_GSM610 = 0x0086, /* DataFusion Systems (Pty) (Ltd) */
108 // ISIAUDIO = 0x0088, /* Iterated Systems, Inc. */
109 // ONLIVE = 0x0089, /* OnLive! Technologies, Inc. */
110 // MULTITUDE_FT_SX20 = 0x008A, /* Multitude Inc. */
111 INFOCOM_ITS_G721_ADPCM = 0x008B, /* Infocom */
112 // CONVEDIA_G729 = 0x008C, /* Convedia Corp. */
113 // CONGRUENCY = 0x008D, /* Congruency Inc. */
114 // SBC24 = 0x0091, /* Siemens Business Communications Sys */
115 // DOLBY_AC3_SPDIF = 0x0092, /* Sonic Foundry */
116 // MEDIASONIC_G723 = 0x0093, /* MediaSonic */
117 // PROSODY_8KBPS = 0x0094, /* Aculab plc */
118 ZYXEL_ADPCM = 0x0097, /* ZyXEL Communications, Inc. */
119 // PHILIPS_LPCBB = 0x0098, /* Philips Speech Processing */
120 // PACKED = 0x0099, /* Studer Professional Audio AG */
121 // MALDEN_PHONYTALK = 0x00A0, /* Malden Electronics Ltd. */
122 // RACAL_RECORDER_GSM = 0x00A1, /* Racal recorders */
123 // RACAL_RECORDER_G720_A = 0x00A2, /* Racal recorders */
124 // RACAL_RECORDER_G723_1 = 0x00A3, /* Racal recorders */
125 // RACAL_RECORDER_TETRA_ACELP = 0x00A4, /* Racal recorders */
126 // NEC_AAC = 0x00B0, /* NEC Corp. */
127 // RAW_AAC1 = 0x00FF, /* For Raw AAC, with format block
128 RHETOREX_ADPCM = 0x0100, /* Rhetorex Inc. */
129 // IRAT = 0x0101, /* BeCubed Software Inc. */
130 // VIVO_G723 = 0x0111, /* Vivo Software */
131 // VIVO_SIREN = 0x0112, /* Vivo Software */
132 // PHILIPS_CELP = 0x0120, /* Philips Speech Processing */
133 // PHILIPS_GRUNDIG = 0x0121, /* Philips Speech Processing */
134 // DIGITAL_G723 = 0x0123, /* Digital Equipment Corporation */
135 SANYO_LD_ADPCM = 0x0125, /* Sanyo Electric Co., Ltd. */
136 // SIPROLAB_ACEPLNET = 0x0130, /* Sipro Lab Telecom Inc. */
137 // SIPROLAB_ACELP4800 = 0x0131, /* Sipro Lab Telecom Inc. */
138 // SIPROLAB_ACELP8V3 = 0x0132, /* Sipro Lab Telecom Inc. */
139 // SIPROLAB_G729 = 0x0133, /* Sipro Lab Telecom Inc. */
140 // SIPROLAB_G729A = 0x0134, /* Sipro Lab Telecom Inc. */
141 // SIPROLAB_KELVIN = 0x0135, /* Sipro Lab Telecom Inc. */
142 // VOICEAGE_AMR = 0x0136, /* VoiceAge Corp. */
143 G726ADPCM = 0x0140, /* Dictaphone Corporation */
144 // DICTAPHONE_CELP68 = 0x0141, /* Dictaphone Corporation */
145 // DICTAPHONE_CELP54 = 0x0142, /* Dictaphone Corporation */
146 // QUALCOMM_PUREVOICE = 0x0150, /* Qualcomm, Inc. */
147 // QUALCOMM_HALFRATE = 0x0151, /* Qualcomm, Inc. */
148 // TUBGSM = 0x0155, /* Ring Zero Systems, Inc. */
149 // MSAUDIO1 = 0x0160, /* Microsoft Corporation */
150 // WMAUDIO2 = 0x0161, /* Microsoft Corporation */
151 // WMAUDIO3 = 0x0162, /* Microsoft Corporation */
152 // WMAUDIO_LOSSLESS = 0x0163, /* Microsoft Corporation */
153 // WMASPDIF = 0x0164, /* Microsoft Corporation */
154 UNISYS_NAP_ADPCM = 0x0170, /* Unisys Corp. */
155 // UNISYS_NAP_ULAW = 0x0171, /* Unisys Corp. */
156 // UNISYS_NAP_ALAW = 0x0172, /* Unisys Corp. */
157 // UNISYS_NAP_16K = 0x0173, /* Unisys Corp. */
158 // SYCOM_ACM_SYC008 = 0x0174, /* SyCom Technologies */
159 // SYCOM_ACM_SYC701_G726L = 0x0175, /* SyCom Technologies */
160 // SYCOM_ACM_SYC701_CELP54 = 0x0176, /* SyCom Technologies */
161 // SYCOM_ACM_SYC701_CELP68 = 0x0177, /* SyCom Technologies */
162 // KNOWLEDGE_ADVENTURE_ADPCM = 0x0178, /* Knowledge Adventure, Inc.*/
163 // FRAUNHOFER_IIS_MPEG2_AAC = 0x0180, /* Fraunhofer IIS */
164 // DTS_DS = 0x0190, /* Digital Theatre Systems, Inc. */
165 // CREATIVE_ADPCM = 0x0200, /* Creative Labs, Inc */
166 // CREATIVE_FASTSPEECH8 = 0x0202, /* Creative Labs, Inc */
167 // CREATIVE_FASTSPEECH10 = 0x0203, /* Creative Labs, Inc */
168 // UHER_ADPCM = 0x0210, /* UHER informatic GmbH */
169 // ULEAD_DV_AUDIO = 0x0215, /* Ulead Systems, Inc. */
170 // ULEAD_DV_AUDIO_1 = 0x0216, /* Ulead Systems, Inc. */
171 // QUARTERDECK = 0x0220, /* Quarterdeck Corporation */
172 // ILINK_VC = 0x0230, /* I-link Worldwide */
173 // RAW_SPORT = 0x0240, /* Aureal Semiconductor */
174 // ESST_AC3 = 0x0241, /* ESS Technology, Inc. */
175 // GENERIC_PASSTHRU = 0x0249,
176 // IPI_HSX = 0x0250, /* Interactive Products, Inc. */
177 // IPI_RPELP = 0x0251, /* Interactive Products, Inc. */
178 // CS2 = 0x0260, /* Consistent Software */
179 // SONY_SCX = 0x0270, /* Sony Corp. */
180 // SONY_SCY = 0x0271, /* Sony Corp. */
181 // SONY_ATRAC3 = 0x0272, /* Sony Corp. */
182 // SONY_SPC = 0x0273, /* Sony Corp. */
183 // TELUM_AUDIO = 0x0280, /* Telum Inc. */
184 // TELUM_IA_AUDIO = 0x0281, /* Telum Inc. */
185 // NORCOM_VOICE_SYSTEMS_ADPCM = 0x0285, /* Norcom Electronics Corp.*/
186 // FM_TOWNS_SND = 0x0300, /* Fujitsu Corp. */
187 // MICRONAS = 0x0350, /* Micronas Semiconductors, Inc. */
188 // MICRONAS_CELP833 = 0x0351, /* Micronas Semiconductors, Inc. */
189 // BTV_DIGITAL = 0x0400, /* Brooktree Corporation */
190 // INTEL_MUSIC_CODER = 0x0401, /* Intel Corp. */
191 // INDEO_AUDIO = 0x0402, /* Ligo */
192 // QDESIGN_MUSIC = 0x0450, /* QDeign Corporation */
193 // ON2_VP7_AUDIO = 0x0500, /* On2 echnologies */
194 // ON2_VP6_AUDIO = 0x0501, /* On2 Tchnologies */
195 // VME_VMPCM = 0x0680, /* AT&T Labs,Inc. */
196 // TPC = 0x0681, /* AT&T Labs, Inc. *
197 // LIGHTWAVE_LOSSLESS = 0x08AE, /* Clerjump */
198 // OLIGSM = 0x1000, /* Ing C. Olivetti C., S.p.A. */
199 // OLIADPCM = 0x1001, /* Ing C. Olivetti& C., S.p.A.*/
200 // OLICELP = 0x1002, /* Ing C. Olivetti &C., S.p.A. */
201 // OLISBC = 0x1003, /* Ing C. Olivetti & C, S.p.A. */
202 // OLIOPR = 0x1004, /* Ing C. Olivetti & C. S.p.A. */
203 // LH_CODEC = 0x1100, /* Lernout & Hauspie *
204 // LH_CODEC_CELP = 0x1101, /* Lernout & Hauspie *
205 // LH_CODEC_SBC8 = 0x1102, /* Lernout & Hauspie */
206 // LH_CODEC_SBC12 = 0x1103, /* Lernout & Hauspie */
207 // LH_CODEC_SBC16 = 0x1104, /* Lernout & Hauspie */
208 // NORRIS = 0x1400, /* Norris Communications, Inc. */
209 // ISIAUDIO_2 = 0x1401, /* ISIAudio */
210 // SOUNDSPACE_MUSICOMPRESS = 0x1500, /* AT&T Labs, Inc. */
211 // MPEG_ADTS_AAC = 0x1600, /* Microsoft Corporation */
212 // MPEG_RAW_AAC = 0x1601, /* Microsoft Corporation */
213 // MPEG_LOAS = 0x1602, /* Microsoft Corporation (MPEG-4 Audio Transport Streams (LOAS/LATM)
214 // NOKIA_MPEG_ADTS_AAC = 0x1608, /* Microsoft Corporation */
215 // NOKIA_MPEG_RAW_AAC = 0x1609, /* Microsoft Corporation */
216 // VODAFONE_MPEG_ADTS_AAC = 0x160A, /* Microsoft Corporation */
217 // VODAFONE_MPEG_RAW_AAC = 0x160B, /* Microsoft Corporation */
218 // MPEG_HEAAC =
219 // 0x1610, /* Microsoft Corporation (MPEG-2 AAC or MPEG-4 HE-AAC
220 // v1/v2 streams with any payload (ADTS, ADIF, LOAS/LATM, RAW). Format block
221 // icludes MP4 AudioSpecificConfig() -- see HEAACWAVEFORMAT below
222 // */
223 // VOXWARE_RT24_SPEECH = 0x181C, /* Voxware Inc. */
224 // SONICFOUNDRY_LOSSLESS = 0x1971, /* Sonic Foundry */
225 // INNINGS_TELECOM_ADPCM = 0x1979, /* Innings Telecom Inc. */
226 // LUCENT_SX8300P = 0x1C07, /* Lucent Technologies */
227 // LUCENT_SX5363S = 0x1C0C, /* Lucent Technologies */
228 // CUSEEME = 0x1F03, /* CUSeeMe */
229 // NTCSOFT_ALF2CM_ACM = 0x1FC4, /* NTCSoft */
230 // DVM = 0x2000, /* FAST Multimedia AG */
231 // DTS2 = 0x2001,
232 // MAKEAVIS = 0x3313,
233 // DIVIO_MPEG4_AAC = 0x4143, /* Divio, Inc. */
234 // NOKIA_ADAPTIVE_MULTIRATE = 0x4201, /* Nokia */
235 // DIVIO_G726 = 0x4243, /* Divio, Inc. */
236 // LEAD_SPEECH = 0x434C, /* LEAD Technologies */
237 // LEAD_VORBIS = 0x564C, /* LEAD Technologies */
238 // WAVPACK_AUDIO = 0x5756, /* xiph.org */
239 // ALAC = 0x6C61, /* Apple Lossless */
240 // OGG_VORBIS_MODE_1 = 0x674F, /* Ogg Vorbis */
241 // OGG_VORBIS_MODE_2 = 0x6750, /* Ogg Vorbis */
242 // OGG_VORBIS_MODE_3 = 0x6751, /* Ogg Vorbis */
243 // OGG_VORBIS_MODE_1_PLUS = 0x676F, /* Ogg Vorbis */
244 // OGG_VORBIS_MODE_2_PLUS = 0x6770, /* Ogg Vorbis */
245 // OGG_VORBIS_MODE_3_PLUS = 0x6771, /* Ogg Vorbis */
246 // F3COM_NBX = 0x7000, /* 3COM Corp. */
247 // OPUS = 0x704F, /* Opus */
248 // FAAD_AAC = 0x706D,
249 MP3 = 0x0055, /* ISO/MPEG Layer3 Format Tag (alias of MPEGLAYER3) */
250 ALAC = 0x6C61, /* Apple Lossless */
251 AAC = 0xA106, /* ISO/MPEG-4 AAC (alias of MPEG4_AAC) */
252 // AMR_NB = 0x7361, /* AMR Narrowband */
253 // AMR_WB = 0x7362, /* AMR Wideband */
254 // AMR_WP = 0x7363, /* AMR Wideband Plus */
255 // GSM_AMR_CBR = 0x7A21, /* GSMA/3GPP */
256 // GSM_AMR_VBR_SID = 0x7A22, /* GSMA/3GPP */
257 // COMVERSE_INFOSYS_G723_1 = 0xA100, /* Comverse Infosys */
258 // COMVERSE_INFOSYS_AVQSBC = 0xA101, /* Comverse Infosys */
259 // COMVERSE_INFOSYS_SBC = 0xA102, /* Comverse Infosys */
260 // SYMBOL_G729_A = 0xA103, /* Symbol Technologies */
261 // VOICEAGE_AMR_WB = 0xA104, /* VoiceAge Corp. */
262 // INGENIENT_G726 = 0xA105, /* Ingenient Technologies, Inc. */
263 // MPEG4_AAC = 0xA106, /* ISO/MPEG-4 */
264 // ENCORE_G726 = 0xA107, /* Encore Software */
265 // ZOLL_ASAO = 0xA108, /* ZOLL Medical Corp. */
266 // SPEEX_VOICE = 0xA109, /* xiph.org */
267 // VIANIX_MASC = 0xA10A, /* Vianix LLC */
268 // WM9_SPECTRUM_ANALYZER = 0xA10B, /* Microsoft */
269 // WMF_SPECTRUM_ANAYZER = 0xA10C, /* Microsoft */
270 // GSM_610 = 0xA0D,
271 // GSM_620 = 0xA1E,
272 // GSM_660 = 0xA10,
273 // GSM_690 = 0xA110,
274 // GSM_ADAPTIVE_MULTIRATE_WB = 0xA111,
275 // POLYCOM_G722 = 0xA112 ,/* Polycom */
276 // POLYCOM_G728 = 0xA113, /* Polycom */
277 // POLYCOM_G729_A = 0xA114, /* Polycom */
278 // POLYCOM_SIREN = 0xA115, /* Polycom */
279 // GLOBAL_IP_ILBC = 0xA116, /* Global IP */
280 // RADIOTIME_TIME_SHIFT_RADIO = 0xA117, /* RadioTime */
281 // NICE_ACA = 0xA118, /* Nice Systems */
282 // NICE_ADPCM = 0xA119, /* Nice Systems */
283 // VOCORD_G721 = 0xA11A, /* Vocord Telecom */
284 // VOCORD_G726 = 0xA11B, /* Vocord Telecom */
285 // VOCORD_G722_1 = 0xA11C, /* Vocord Telecom */
286 // VOCORD_G728 = 0xA11D, /* Vocord Telecom */
287 // VOCORD_G729 = 0xA11E, /* Vocord Telecom */
288 // VOCORD_G729_A = 0xA11F, /* Vocord Telecom */
289 // VOCORD_G723_1 = 0xA120, /* Vocord Telecom */
290 // VOCORD_LBC = 0xA121, /* Vocord Telecom */
291 // NICE_G728 = 0xA122, /* Nice Systems */
292 // FRACE_TELECOM_G729 = 0xA123, /* France Telecom */
293 // CODIAN = 0xA124, /* CODIAN */
294 // FLAC = 0xF1AC, /* flac.sourceforge.net */
295};
296
300inline const char* toMime(AudioFormat format) {
301 switch (format) {
302 // PCM and all ADPCM variants are handled via the WAV decoder
303 case AudioFormat::PCM:
306 case AudioFormat::DVI_ADPCM: // == IMA_ADPCM (same wav code, alias)
327 return "audio/wav";
329 return "audio/l32f";
331 return "audio/alaw";
333 return "audio/mulaw";
334 case AudioFormat::MP3:
335 return "audio/mpeg";
336 case AudioFormat::AAC:
337 return "audio/aac";
339 return "audio/alac";
340 default:
341 return nullptr;
342 }
343}
344
348inline bool isWavFormat(AudioFormat format) {
349 const char* mime = toMime(format);
350 return mime != nullptr && strcmp(mime, "audio/wav") == 0;
351}
352
361inline AudioFormat fromMime(const char* mime) {
362 if (mime == nullptr) return AudioFormat::UNKNOWN;
363 if (strcmp(mime, "audio/wav") == 0) return AudioFormat::PCM;
364 if (strcmp(mime, "audio/l32f") == 0) return AudioFormat::IEEE_FLOAT;
365 if (strcmp(mime, "audio/alaw") == 0) return AudioFormat::ALAW;
366 if (strcmp(mime, "audio/mulaw") == 0) return AudioFormat::MULAW;
367 if (strcmp(mime, "audio/mpeg") == 0) return AudioFormat::MP3;
368 if (strcmp(mime, "audio/aac") == 0) return AudioFormat::AAC;
369 if (strcmp(mime, "audio/alac") == 0) return AudioFormat::ALAC;
371}
372
389struct AudioInfoFormat : public AudioInfo, public MimeSource {
390 AudioInfoFormat() = default;
391 AudioInfoFormat(const AudioInfo &from) : AudioInfo(from) {}
392 AudioInfoFormat(sample_rate_t sampleRate, uint16_t channelCount,
393 uint8_t bitsPerSample,
394 AudioFormat audioFormat = AudioFormat::UNKNOWN)
395 : AudioInfo(sampleRate, channelCount, bitsPerSample),
396 format(audioFormat) {}
397
399
401 const char *mime() override { return toMime(format); }
402};
403
404}
Abstract interface for classes that can provide MIME type information.
Definition AudioTypes.h:547
uint32_t sample_rate_t
Type alias for sample rate values.
Definition AudioTypes.h:19
AudioFormat
Audio format codes used by Microsoft e.g. in avi or wav files.
Definition AudioFormat.h:21
const char * toMime(AudioFormat format)
Provides the mime type for a AudioFormat wav code, or nullptr if not known/mapped.
Definition AudioFormat.h:300
bool isWavFormat(AudioFormat format)
True if the wav code is handled via the WAV decoder (i.e. toMime() maps it to "audio/wav": PCM and al...
Definition AudioFormat.h:348
AudioFormat fromMime(const char *mime)
Best-effort inverse of toMime(): maps a mime type (e.g. an AudioEncoder's mime()) back to the AudioFo...
Definition AudioFormat.h:361
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition LMSEchoCancellationStream.h:6
AudioInfo extended with a WAVEFORMATEX-style codec tag (the "wav code"): identifies the codec (PCM,...
Definition AudioFormat.h:389
AudioFormat format
Definition AudioFormat.h:398
AudioInfoFormat(sample_rate_t sampleRate, uint16_t channelCount, uint8_t bitsPerSample, AudioFormat audioFormat=AudioFormat::UNKNOWN)
Definition AudioFormat.h:392
AudioInfoFormat(const AudioInfo &from)
Definition AudioFormat.h:391
const char * mime() override
Mime type corresponding to format (see toMime()), nullptr if unmapped.
Definition AudioFormat.h:401
Basic Audio information which drives e.g. I2S.
Definition AudioTypes.h:51