7#include "ATRACDecoder.h"
44 const char *
mime()
override {
return "audio/atrac"; }
49 LOGE(
"setType() must be called before begin()");
96 bool begin(ATRACType
type,
int sampleRate,
int channels,
int blockAlign,
97 const uint8_t *extra =
nullptr,
size_t extraSize = 0) {
102 cfg.sampleRate = sampleRate;
103 cfg.channels = channels;
104 cfg.blockAlign = blockAlign;
105 cfg.extradata = extra;
106 cfg.extradataSize = extraSize;
109 LOGE(
"ATRAC decoder could not be opened (type: %d)", (
int)
type);
120 LOGE(
"ATRAC block size is not defined");
133 LOGI(
"ATRAC %s: %d Hz, %d channels, %d bytes/frame",
p_decoder->codecName(),
194 LOGD(
"ATRAC decode: no output (error: %d)",
p_decoder->lastError());
197 if (
p_print ==
nullptr)
return;
203 LOGE(
"write error: %d bytes lost", (
int)open);
214 if (extra ==
nullptr || size != 12)
return 0;
216 int frame_size = ((e[2] << 3) | (e[3] >> 5)) + 1;
217 int superframe = (e[3] >> 3) & 0x3;
#define TRACED()
Definition AudioLoggerIDF.h:31
#define LOGI(...)
Definition AudioLoggerIDF.h:28
#define LOGD(...)
Definition AudioLoggerIDF.h:27
#define LOGE(...)
Definition AudioLoggerIDF.h:30
virtual size_t write(const uint8_t *data, size_t len)
Definition Arduino.h:120
AudioFormat
Audio format codes used by Microsoft e.g. in avi or wav files.
Definition AudioFormat.h:21
@ ATRAC3
Sony ATRAC3 (the tag is called SONY_SCX in some lists)