@@ -59,8 +59,8 @@ class ADTSParser {
5959 header.num_rawdata_blocks = (hdr[6 ]) & 0b11 ;
6060
6161 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 );
6464
6565 // check
6666 is_valid = check ();
@@ -71,8 +71,8 @@ class ADTSParser {
7171
7272 void log () {
7373 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 );
7676 }
7777
7878 int getSampleRate () {
@@ -210,6 +210,33 @@ class ADTSDecoder : public AudioDecoder {
210210 // / Defines the parse buffer size: default is 1024
211211 void setParseBufferSize (int size) { buffer.resize (size); }
212212
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+
213240 protected:
214241 SingleBuffer<uint8_t > buffer{DEFAULT_BUFFER_SIZE};
215242 SingleBuffer<uint8_t > out_buffer;
0 commit comments