@@ -59,8 +59,8 @@ class ADTSParser {
59
59
header.num_rawdata_blocks = (hdr[6 ]) & 0b11 ;
60
60
61
61
LOGD (" id:%d layer:%d profile:%d freq:%d channel:%d frame_length:%d" ,
62
- header.id , header.layer , header.profile , getSampleRate (), header. channel_cfg ,
63
- header.frame_length );
62
+ header.id , header.layer , header.profile , getSampleRate (),
63
+ header.channel_cfg , header. frame_length );
64
64
65
65
// check
66
66
is_valid = check ();
@@ -71,8 +71,8 @@ class ADTSParser {
71
71
72
72
void log () {
73
73
LOGI (" %s id:%d layer:%d profile:%d freq:%d channel:%d frame_length:%d" ,
74
- is_valid ? " +" : " -" , header.id , header.layer , header.profile , getSampleRate (),
75
- header.channel_cfg , header.frame_length );
74
+ is_valid ? " +" : " -" , header.id , header.layer , header.profile ,
75
+ getSampleRate (), header.channel_cfg , header.frame_length );
76
76
}
77
77
78
78
int getSampleRate () {
@@ -210,6 +210,33 @@ class ADTSDecoder : public AudioDecoder {
210
210
// / Defines the parse buffer size: default is 1024
211
211
void setParseBufferSize (int size) { buffer.resize (size); }
212
212
213
+ // / Defines where the decoded result is written to
214
+ virtual void setOutput (AudioStream &out_stream) {
215
+ if (p_dec) {
216
+ p_dec->setOutput (out_stream);
217
+ } else {
218
+ AudioDecoder::setOutput (out_stream);
219
+ }
220
+ }
221
+
222
+ // / Defines where the decoded result is written to
223
+ virtual void setOutput (AudioOutput &out_stream) {
224
+ if (p_dec) {
225
+ p_dec->setOutput (out_stream);
226
+ } else {
227
+ AudioDecoder::setOutput (out_stream);
228
+ }
229
+ }
230
+
231
+ // / Defines where the decoded result is written to
232
+ virtual void setOutput (Print &out_stream) override {
233
+ if (p_dec) {
234
+ p_dec->setOutput (out_stream);
235
+ } else {
236
+ AudioDecoder::setOutput (out_stream);
237
+ }
238
+ }
239
+
213
240
protected:
214
241
SingleBuffer<uint8_t > buffer{DEFAULT_BUFFER_SIZE};
215
242
SingleBuffer<uint8_t > out_buffer;
0 commit comments