arduino-audio-tools
Loading...
Searching...
No Matches
AudioPlayer.h
Go to the documentation of this file.
1#pragma once
2
3#include "AudioToolsConfig.h"
16
22
23namespace audio_tools {
24
52 public:
55
65 AudioPlayer(AudioSource& source, AudioOutput& output, AudioDecoder& decoder) {
66 TRACED();
67 this->p_source = &source;
68 this->p_decoder = &decoder;
69 setOutput(output);
70 // notification for audio configuration
71 decoder.addNotifyAudioChange(*this);
72 }
73
84 AudioPlayer(AudioSource& source, Print& output, AudioDecoder& decoder,
85 AudioInfoSupport* notify = nullptr) {
86 TRACED();
87 this->p_source = &source;
88 this->p_decoder = &decoder;
89 setOutput(output);
91 }
92
102 AudioPlayer(AudioSource& source, AudioStream& output, AudioDecoder& decoder) {
103 TRACED();
104 this->p_source = &source;
105 this->p_decoder = &decoder;
106 setOutput(output);
107 // notification for audio configuration
108 decoder.addNotifyAudioChange(*this);
109 }
110
112 AudioPlayer(AudioPlayer const&) = delete;
113
116
118 void setOutput(AudioOutput& output) {
119 if (p_decoder->isResultPCM()) {
120 this->fade.setOutput(output);
121 this->volume_out.setOutput(fade);
122 out_decoding.setOutput(&volume_out);
123 out_decoding.setDecoder(p_decoder);
124 } else {
125 out_decoding.setOutput(&output);
126 out_decoding.setDecoder(p_decoder);
127 }
128 this->p_final_print = &output;
129 this->p_final_stream = nullptr;
130 }
131
133 void setOutput(Print& output) {
134 if (p_decoder->isResultPCM()) {
135 this->fade.setOutput(output);
136 this->volume_out.setOutput(fade);
137 out_decoding.setOutput(&volume_out);
138 out_decoding.setDecoder(p_decoder);
139 } else {
140 out_decoding.setOutput(&output);
141 out_decoding.setDecoder(p_decoder);
142 }
143 this->p_final_print = nullptr;
144 this->p_final_stream = nullptr;
145 }
146
148 void setOutput(AudioStream& output) {
149 if (p_decoder->isResultPCM()) {
150 this->fade.setOutput(output);
151 this->volume_out.setOutput(fade);
152 out_decoding.setOutput(&volume_out);
153 out_decoding.setDecoder(p_decoder);
154 } else {
155 out_decoding.setOutput(&output);
156 out_decoding.setDecoder(p_decoder);
157 }
158 this->p_final_print = nullptr;
159 this->p_final_stream = &output;
160 }
161
163 void setBufferSize(int size) { copier.resize(size); }
164
166 bool begin(int index = 0, bool isActive = true) {
167 TRACED();
168 bool result = false;
169 // initilaize volume
170 if (current_volume == -1.0f) {
171 setVolume(1.0f);
172 } else {
174 }
175
176 // take definition from source
177 autonext = p_source->isAutoNext();
178
179 // initial audio info for fade from output when not defined yet
180 setupFade();
181
182 // start dependent objects
183 out_decoding.begin();
184
185 if (!p_source->begin()) {
186 LOGE("Could not start audio source");
187 return false;
188 }
189 if (!meta_out.begin()) {
190 LOGE("Could not start metadata output");
191 return false;
192 }
193 if (!volume_out.begin()) {
194 LOGE("Could not start volume control");
195 return false;
196 }
197
198 if (index >= 0) {
199 setStream(p_source->selectStream(index));
200 if (p_input_stream != nullptr) {
201 if (meta_active) {
202 copier.setCallbackOnWrite(decodeMetaData, this);
203 }
205 timeout = millis() + p_source->timeoutAutoNext();
207 result = true;
208 } else {
209 LOGW("-> begin: no data found");
210 active = false;
211 result = false;
212 }
213 } else {
214 LOGW("-> begin: no stream selected");
216 result = false;
217 }
218 return result;
219 }
220
222 void end() {
223 TRACED();
224 active = false;
225 eof_called = false;
226 out_decoding.end();
227 meta_out.end();
228 // remove any data in the decoder
229 if (p_decoder != nullptr) {
230 LOGI("reset codec");
231 p_decoder->end();
232 p_decoder->begin();
233 }
234 }
235
238
240 void setAudioSource(AudioSource& source) { this->p_source = &source; }
241
243 void setDecoder(AudioDecoder& decoder) {
244 this->p_decoder = &decoder;
245 out_decoding.setDecoder(p_decoder);
246 }
247
250 this->p_final_notify = notify;
251 // notification for audio configuration
252 if (p_decoder != nullptr) {
253 p_decoder->addNotifyAudioChange(*this);
254 }
255 }
256
258 void setAudioInfo(AudioInfo info) override {
259 TRACED();
260 LOGI("sample_rate: %d", (int)info.sample_rate);
261 LOGI("bits_per_sample: %d", (int)info.bits_per_sample);
262 LOGI("channels: %d", (int)info.channels);
263 this->info = info;
264 // notifiy volume
265 volume_out.setAudioInfo(info);
266 fade.setAudioInfo(info);
267 // notifiy final ouput: e.g. i2s
268 if (p_final_print != nullptr) p_final_print->setAudioInfo(info);
269 if (p_final_stream != nullptr) p_final_stream->setAudioInfo(info);
270 if (p_final_notify != nullptr) p_final_notify->setAudioInfo(info);
271 };
272
274 AudioInfo audioInfo() override { return info; }
275
278 void play() {
279 TRACED();
280 setActive(true);
281 }
282
286 bool playPath(const char* path) {
287 TRACED();
288 if (!setPath(path)) {
289 LOGW("Could not open file: %s", path);
290 return false;
291 }
292
293 LOGI("Playing %s", path);
294 // start if inactive
295 play();
296 // process all data
297 copyAll();
298
299 LOGI("%s has finished playing", path);
300 return true;
301 }
302
304 bool playFile(const char* path) { return playPath(path); }
305
307 void stop() {
308 TRACED();
309 setActive(false);
310 }
311
331 void clearBuffers(bool drainSource = false) {
332 TRACED();
333 if (drainSource && p_input_stream != nullptr) {
334 // Snapshot once: a live source keeps receiving new bytes
335 // continuously, so re-checking available() after every read could
336 // never terminate - only discard what had already piled up up to
337 // this point. Anything that arrives during the drain is fresh
338 // ("now") data anyway, so leaving it for normal playback after
339 // resuming is correct, not a bug.
340 int remaining = p_input_stream->available();
341 uint8_t tmp[256];
342 while (remaining > 0) {
343 int to_read = min(remaining, (int)sizeof(tmp));
344 int got = p_input_stream->readBytes(tmp, to_read);
345 if (got <= 0) break; // stream stalled - stop rather than spin
346 remaining -= got;
347 }
348 }
349 if (p_decoder != nullptr) {
350 p_decoder->end();
351 p_decoder->begin();
352 }
353 }
354
356 bool next(int offset = 1) {
357 TRACED();
358 writeEnd();
359 stream_increment = offset >= 0 ? 1 : -1;
360 active = setStream(p_source->nextStream(offset));
361 return active;
362 }
363
365 bool setIndex(int idx) {
366 TRACED();
367 writeEnd();
369 active = setStream(p_source->selectStream(idx));
370 return active;
371 }
372
374 bool setPath(const char* path) {
375 TRACED();
376 writeEnd();
378 active = setStream(p_source->selectStream(path));
379 return active;
380 }
381
383 bool previous(int offset = 1) {
384 TRACED();
385 writeEnd();
386 stream_increment = -1;
387 active = setStream(p_source->previousStream(abs(offset)));
388 return active;
389 }
390
392 bool setStream(Stream* input) {
393 end();
394 out_decoding.begin();
395 p_input_stream = input;
396 eof_called = false; // reset EOF state for new stream
397 if (p_input_stream != nullptr) {
398 LOGD("open selected stream");
399 meta_out.begin();
401 }
402 // execute callback if defined
403 if (on_stream_change_callback != nullptr)
405 return p_input_stream != nullptr;
406 }
407
410
412 bool isActive() { return active; }
413
415 operator bool() { return isActive(); }
416
418 void setActive(bool isActive) {
419 if (is_auto_fade) {
420 if (isActive) {
421 fade.setFadeInActive(true);
422 } else {
423 fade.setFadeOutActive(true);
424 copier.copy();
425 writeSilence(2048);
426 }
427 }
429 }
430
432 bool setVolume(float volume) override {
433 bool result = true;
434 if (volume >= 0.0f && volume <= 1.0f) {
435 if (abs(volume - current_volume) > 0.01f) {
436 LOGI("setVolume(%f)", volume);
437 volume_out.setVolume(volume);
439 }
440 } else {
441 LOGE("setVolume value '%f' out of range (0.0 -1.0)", volume);
442 result = false;
443 }
444 return result;
445 }
446
448 bool setVolume(float volume, int channel) {
449 return volume_out.setVolume(volume, channel);
450 }
451
453 float volume() override { return current_volume; }
454
456 float volume(int channel) { return volume_out.volume(channel); }
457
459 void setAutoNext(bool next) { autonext = next; }
460
462 void setDelayIfOutputFull(int delayMs) { delay_if_full = delayMs; }
463
466 size_t copy() { return copy(copier.bufferSize()); }
467
469 size_t copyAll() {
470 size_t result = 0;
471 size_t step = copy();
472 while (step > 0) {
473 result += step;
474 step = copy();
475 }
476 return result;
477 }
478
480 size_t copy(size_t bytes) {
481 size_t result = 0;
482 if (active) {
483 if (delay_if_full != 0 && ((p_final_print != nullptr &&
484 p_final_print->availableForWrite() == 0) ||
485 (p_final_stream != nullptr &&
486 p_final_stream->availableForWrite() == 0))) {
487 // not ready to do anything - so we wait a bit
489 LOGD("copy: %d -> 0", (int)bytes);
490 return 0;
491 }
492
493 // handle sound
494 result = copier.copyBytes(bytes);
495 if (result > 0 || timeout == 0) {
496 // reset timeout if we had any data
497 timeout = millis() + p_source->timeoutAutoNext();
498 }
499
500 // move to next stream after timeout
502
503 // return silence when there was no data
504 if (result < bytes && silence_on_inactive) {
505 writeSilence(bytes - result);
506 }
507
508 } else {
509 // e.g. A2DP should still receive data to keep the connection open
511 writeSilence(bytes);
512 }
513 }
514 LOGD("copy: %d -> %d", (int)bytes, (int)result);
515 return result;
516 }
517
519 void setVolumeControl(VolumeControl& vc) { volume_out.setVolumeControl(vc); }
520
524
527
530
532 void writeSilence(size_t bytes) {
533 TRACEI();
534 if (p_final_print != nullptr) {
535 p_final_print->writeSilence(bytes);
536 } else if (p_final_stream != nullptr) {
537 p_final_stream->writeSilence(bytes);
538 }
539 }
540
543
546
548 bool isAutoFade() { return is_auto_fade; }
549
551 void setMetaDataSize(int size) { meta_out.resize(size); }
552
554 void setReference(void* ref) { p_reference = ref; }
555
557 void setMetadataCallback(void (*callback)(MetaDataType type, const char* str,
558 int len),
560 TRACEI();
561 // setup metadata.
562 if (p_source->setMetadataCallback(callback)) {
563 // metadata is handled by source
564 LOGI("Using ICY Metadata");
565 meta_active = false;
566 } else {
567 // metadata is handled here
568 meta_out.setCallback(callback);
569 meta_out.setFilter(sel);
570 meta_active = true;
571 }
572 }
573
575 void setOnStreamChangeCallback(void (*callback)(Stream* stream_ptr,
576 void* reference)) {
577 on_stream_change_callback = callback;
578 if (p_input_stream != nullptr) callback(p_input_stream, p_reference);
579 }
580
584 void setOnEOFCallback(void (*callback)(AudioPlayer& player)) {
585 on_eof_callback = callback;
586 }
587
589 bool setMuted(bool muted) {
590 if (muted) {
591 if (current_volume > 0.0f) {
593 setVolume(0.0f);
594 }
595 } else {
596 if (muted_volume > 0.0f) {
598 muted_volume = 0.0f;
599 }
600 }
601 return true;
602 }
603
605 bool isMuted() { return current_volume == 0.0f; }
606
607 protected:
608 bool active = false;
609 bool autonext = true;
612 VolumeStream volume_out; // Volume control
613 FadeStream fade; // Phase in / Phase Out to avoid popping noise
614 MetaDataID3 meta_out; // Metadata parser
622 StreamCopy copier; // copies sound into i2s
624 bool meta_active = false;
625 uint32_t timeout = 0;
626 int stream_increment = 1; // +1 moves forward; -1 moves backward
627 float current_volume = -1.0f; // illegal value which will trigger an update
628 float muted_volume = 0.0f;
629 int delay_if_full = 100;
630 bool is_auto_fade = true;
631 void* p_reference = nullptr;
633 void* reference) = nullptr;
634 // EOF callback and guard (invoked once when current stream reaches end)
635 void (*on_eof_callback)(AudioPlayer& player) = nullptr;
636 bool eof_called = false;
637
638 void setupFade() {
639 if (p_final_print != nullptr) {
640 fade.setAudioInfo(p_final_print->audioInfo());
641 } else if (p_final_stream != nullptr) {
642 fade.setAudioInfo(p_final_stream->audioInfo());
643 }
644 }
645
647 if (p_final_stream != nullptr && p_final_stream->availableForWrite() == 0)
648 return;
649 if (p_input_stream == nullptr || millis() > timeout) {
650 if (is_auto_fade) fade.setFadeInActive(true);
651
652 // EOF callback: trigger once per stream
653 if (!eof_called) {
654 eof_called = true;
655 if (on_eof_callback != nullptr) {
656 on_eof_callback(*this);
657 }
658 }
659
660 if (autonext) {
661 LOGI("-> timeout - moving by %d", stream_increment);
662 // open next stream
663 if (!next(stream_increment)) {
664 LOGD("stream is null");
665 }
666 } else {
667 active = false;
668 }
669 timeout = millis() + p_source->timeoutAutoNext();
670 }
671 }
672
673 void writeEnd() {
674 // end silently
675 TRACEI();
676 if (is_auto_fade) {
677 fade.setFadeOutActive(true);
678 copier.copy();
679 // start by fading in
680 fade.setFadeInActive(true);
681 }
682 // restart the decoder to make sure it does not contain any audio when we
683 // continue
684 p_decoder->begin();
685 eof_called = false; // prepare for next stream
686 // Discard whatever of the just-faded-out stream is still sitting in the
687 // output's own buffer (e.g. an I2S DMA buffer) but not yet physically
688 // played. Without this, opening the next stream below can block for a
689 // while (file/network I/O), during which that leftover old-stream audio
690 // keeps playing out on its own - heard as a chunk of the previous track
691 // after the switch instead of a clean cut to the new one. No-op for
692 // outputs that don't support it.
693 if (p_final_print != nullptr) {
694 p_final_print->flush();
695 } else if (p_final_stream != nullptr) {
696 p_final_stream->flush();
697 }
698 }
699
701 static void decodeMetaData(void* obj, void* data, size_t len) {
702 LOGD("%s, %zu", LOG_METHOD, len);
703 AudioPlayer* p = (AudioPlayer*)obj;
704 if (p->meta_active) {
705 p->meta_out.write((const uint8_t*)data, len);
706 }
707 }
708};
709
710} // namespace audio_tools
#define LOGW(...)
#define TRACEI()
#define TRACED()
#define LOGI(...)
#define LOGD(...)
#define LOG_METHOD
#define LOGE(...)
Decoding of encoded audio into PCM data.
Definition AudioCodecsBase.h:19
Supports changes to the sampling rate, bits and channels.
Definition AudioTypes.h:137
Abstract Audio Ouptut class.
Definition AudioOutput.h:25
void setupFade()
Definition AudioPlayer.h:638
bool active
Definition AudioPlayer.h:608
void writeEnd()
Definition AudioPlayer.h:673
static void decodeMetaData(void *obj, void *data, size_t len)
Callback implementation which writes to metadata.
Definition AudioPlayer.h:701
void setOutput(Print &output)
Sets the final output to a Print (adds Volume/Fade for PCM).
Definition AudioPlayer.h:133
bool meta_active
Definition AudioPlayer.h:624
void setAudioSource(AudioSource &source)
Sets or replaces the AudioSource.
Definition AudioPlayer.h:240
int delay_if_full
Definition AudioPlayer.h:629
void writeSilence(size_t bytes)
Writes the requested number of zero bytes to the output.
Definition AudioPlayer.h:532
AudioOutput * p_final_print
Definition AudioPlayer.h:619
AudioPlayer(AudioSource &source, AudioStream &output, AudioDecoder &decoder)
Construct a new Audio Player object. The processing chain is AudioSource -> Stream-copy -> EncodedAud...
Definition AudioPlayer.h:102
AudioSource & audioSource()
Returns the active AudioSource.
Definition AudioPlayer.h:237
CopyDecoder no_decoder
Definition AudioPlayer.h:616
bool eof_called
Definition AudioPlayer.h:636
size_t copy(size_t bytes)
Copies the requested bytes from source to decoder (call in loop).
Definition AudioPlayer.h:480
int stream_increment
Definition AudioPlayer.h:626
size_t copyAll()
Copies until source is exhausted (blocking).
Definition AudioPlayer.h:469
void setSilenceOnInactive(bool active)
When enabled, writes zeros while inactive to keep sinks alive.
Definition AudioPlayer.h:526
bool isMuted()
Returns true if the player is currently muted.
Definition AudioPlayer.h:605
void moveToNextFileOnTimeout()
Definition AudioPlayer.h:646
void setOnEOFCallback(void(*callback)(AudioPlayer &player))
Definition AudioPlayer.h:584
bool isSilenceOnInactive()
Returns whether silence-on-inactive is enabled.
Definition AudioPlayer.h:529
void(* on_stream_change_callback)(Stream *stream_ptr, void *reference)
Definition AudioPlayer.h:632
void setOnStreamChangeCallback(void(*callback)(Stream *stream_ptr, void *reference))
Defines a callback that is called when the stream is changed.
Definition AudioPlayer.h:575
void(* on_eof_callback)(AudioPlayer &player)
Definition AudioPlayer.h:635
void setDelayIfOutputFull(int delayMs)
Sets delay (ms) to wait when output is full.
Definition AudioPlayer.h:462
void setMetaDataSize(int size)
Sets the maximum ID3 metadata buffer size (default 256).
Definition AudioPlayer.h:551
bool setStream(Stream *input)
Activates the provided Stream as current input.
Definition AudioPlayer.h:392
void setDecoder(AudioDecoder &decoder)
Sets or replaces the AudioDecoder.
Definition AudioPlayer.h:243
StreamCopy & getStreamCopy()
Definition AudioPlayer.h:523
bool isAutoFade()
Checks whether automatic fade in/out is enabled.
Definition AudioPlayer.h:548
AudioInfo info
Definition AudioPlayer.h:623
AudioStream * p_final_stream
Definition AudioPlayer.h:620
bool playFile(const char *path)
Obsolete: use PlayPath!
Definition AudioPlayer.h:304
VolumeStream volume_out
Definition AudioPlayer.h:612
FadeStream fade
Definition AudioPlayer.h:613
bool setVolume(float volume) override
Sets volume in range [0.0, 1.0]; updates VolumeStream.
Definition AudioPlayer.h:432
Stream * getStream()
Returns the currently active input Stream (e.g., file).
Definition AudioPlayer.h:409
void play()
Definition AudioPlayer.h:278
AudioSource * p_source
Definition AudioPlayer.h:611
bool next(int offset=1)
Moves to the next/previous stream by offset (negative supported).
Definition AudioPlayer.h:356
void clearBuffers(bool drainSource=false)
Definition AudioPlayer.h:331
float volume() override
Returns the current volume [0.0, 1.0].
Definition AudioPlayer.h:453
bool playPath(const char *path)
Definition AudioPlayer.h:286
bool silence_on_inactive
Definition AudioPlayer.h:610
EncodedAudioOutput out_decoding
Definition AudioPlayer.h:615
bool autonext
Definition AudioPlayer.h:609
void addNotifyAudioChange(AudioInfoSupport *notify)
Adds/updates a listener notified on audio info changes.
Definition AudioPlayer.h:249
void stop()
Halts playback; equivalent to setActive(false).
Definition AudioPlayer.h:307
AudioDecoder * p_decoder
Definition AudioPlayer.h:617
StreamCopy copier
Definition AudioPlayer.h:622
void setAutoNext(bool next)
Enables/disables auto-advance at end/timeout (overrides AudioSource).
Definition AudioPlayer.h:459
void setReference(void *ref)
Sets a user reference passed to the stream-change callback.
Definition AudioPlayer.h:554
AudioInfoSupport * p_final_notify
Definition AudioPlayer.h:621
AudioPlayer()
Default constructor.
Definition AudioPlayer.h:54
void setAutoFade(bool active)
Enables/disables automatic fade in/out to prevent pops.
Definition AudioPlayer.h:545
void setMetadataCallback(void(*callback)(MetaDataType type, const char *str, int len), ID3TypeSelection sel=SELECT_ID3)
Defines the metadata callback.
Definition AudioPlayer.h:557
void setOutput(AudioOutput &output)
Sets the final output to an AudioOutput (adds Volume/Fade for PCM).
Definition AudioPlayer.h:118
bool isActive()
Checks whether playback is active.
Definition AudioPlayer.h:412
bool previous(int offset=1)
Moves back by offset streams (defaults to 1).
Definition AudioPlayer.h:383
void end()
Ends playback and resets decoder/intermediate stages.
Definition AudioPlayer.h:222
bool is_auto_fade
Definition AudioPlayer.h:630
uint32_t timeout
Definition AudioPlayer.h:625
VolumeStream & getVolumeStream()
Returns the VolumeStream used by the player.
Definition AudioPlayer.h:542
bool setPath(const char *path)
Selects stream by path without changing the source iterator.
Definition AudioPlayer.h:374
bool begin(int index=0, bool isActive=true)
Starts or restarts playback from the first or given stream index.
Definition AudioPlayer.h:166
MetaDataID3 meta_out
Definition AudioPlayer.h:614
Stream * p_input_stream
Definition AudioPlayer.h:618
void setAudioInfo(AudioInfo info) override
Receives and forwards updated AudioInfo to the chain.
Definition AudioPlayer.h:258
void setActive(bool isActive)
Toggles playback activity; triggers fade and optional silence.
Definition AudioPlayer.h:418
void setBufferSize(int size)
Sets the internal copy buffer size (bytes).
Definition AudioPlayer.h:163
float muted_volume
Definition AudioPlayer.h:628
AudioPlayer & operator=(AudioPlayer const &)=delete
Non-assignable: assignment operator is deleted.
void * p_reference
Definition AudioPlayer.h:631
void setOutput(AudioStream &output)
Sets the final output to an AudioStream (adds Volume/Fade for PCM).
Definition AudioPlayer.h:148
size_t copy()
Definition AudioPlayer.h:466
AudioInfo audioInfo() override
Returns the current AudioInfo of the playback chain.
Definition AudioPlayer.h:274
bool setIndex(int idx)
Selects stream by absolute index in the source.
Definition AudioPlayer.h:365
AudioPlayer(AudioSource &source, AudioOutput &output, AudioDecoder &decoder)
Construct a new Audio Player object. The processing chain is AudioSource -> Stream-copy -> EncodedAud...
Definition AudioPlayer.h:65
bool setMuted(bool muted)
Mutes or unmutes the audio player.
Definition AudioPlayer.h:589
bool setVolume(float volume, int channel)
Defines the volume for the indicated channel.
Definition AudioPlayer.h:448
float current_volume
Definition AudioPlayer.h:627
void setVolumeControl(VolumeControl &vc)
Sets a custom VolumeControl implementation.
Definition AudioPlayer.h:519
float volume(int channel)
Returns the current volume for the indicated channel.
Definition AudioPlayer.h:456
AudioPlayer(AudioSource &source, Print &output, AudioDecoder &decoder, AudioInfoSupport *notify=nullptr)
Construct a new Audio Player object. The processing chain is AudioSource -> Stream-copy -> EncodedAud...
Definition AudioPlayer.h:84
AudioPlayer(AudioPlayer const &)=delete
Non-copyable: copy constructor is deleted.
Abstract Audio Data Source for the AudioPlayer which is used by the Audio Players.
Definition AudioSource.h:17
Base class for all Audio Streams. It support the boolean operator to test if the object is ready with...
Definition BaseStream.h:120
Dummy Decoder which just copies the provided data to the output. You can define if it is PCM data.
Definition CodecCopy.h:18
A more natural Print class to process encoded data (aac, wav, mp3...). Just define the output and the...
Definition AudioEncoded.h:21
Stream which can be used to manage fade in and fade out. Before you read or write data you need to ca...
Definition Fade.h:241
Simple ID3 Meta Data Parser which supports ID3 V1 and V2 and implements the Stream interface....
Definition MetaDataID3.h:570
virtual size_t write(const uint8_t *data, size_t len)
Provide tha audio data to the API to parse for Meta Data.
Definition MetaDataID3.h:602
Definition CodecOpusOgg.h:57
Definition CodecOpusOgg.h:137
Abstract class for handling of the linear input volume to determine the multiplication factor which s...
Definition VolumeControl.h:19
Adjust the volume of the related input or output: To work properly the class needs to know the bits p...
Definition VolumeStream.h:35
Supports the setting and getting of the volume.
Definition AudioTypes.h:193
virtual void addNotifyAudioChange(AudioInfoSupport &bi)
Adds target to be notified about audio changes.
Definition CodecOpusOgg.h:155
ID3TypeSelection
Enum to filter by type of metadata.
Definition AbstractMetaData.h:8
MetaDataType
Type of meta info.
Definition AbstractMetaData.h:11
@ SELECT_ID3
Definition AbstractMetaData.h:8
StreamCopyT< uint8_t > StreamCopy
We provide the typeless StreamCopy.
Definition StreamCopy.h:430
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition LMSEchoCancellationStream.h:6
void delay(uint32_t ms)
Definition Arduino.h:259
uint32_t millis()
Returns the milliseconds since the start.
Definition Arduino.h:260
Basic Audio information which drives e.g. I2S.
Definition AudioTypes.h:56