Misleading log output #10
-
Hello,
In particular, the line specifying the end of frame (82) and end of decoding (417). I know that the previous frame was 417 byte long, but does this mean that there will be more bytes used for decoding this particular frame than the size of this frame (82 bytes)? I have studied the code in function |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
If I remember right the decoder grabs as much as is able to process and reports back how may bytes it has processed. ps. I admit that the implementation is a bit messy and I would do it differently today because I could use functionality from the AudioTools that were just not available yet, when this has been implemented. |
Beta Was this translation helpful? Give feedback.
-
Sorry to be picky, I just want to understand why the decoder could use for decoding more bytes than specified in the current frame. I have read about bit reservoir, and I can see that the info about bit reservoir is only available for AAC (ADIF bufferFull), and is not defined for MP3. arduino-libhelix/src/libhelix-mp3/mp3dec.c Lines 339 to 392 in 27d09c3 but there the bytesLeft calculation is mixed somehow with the available/used bytes from the mp3DecInfo->mainBuf , which has normally nothing to do with the read bytes from the current frame of the stream.So I really have doubt about the meaning of this variable. |
Beta Was this translation helpful? Give feedback.
-
bytesLeft is the total amount of available memory in the buffer that can be used for decoding. |
Beta Was this translation helpful? Give feedback.
-
The link I posted points to |
Beta Was this translation helpful? Give feedback.
-
Well, as I said - that code is not from me so I am not commenting on this. |
Beta Was this translation helpful? Give feedback.
If I remember right the decoder grabs as much as is able to process and reports back how may bytes it has processed.
In my logic I just make sure that if I submit some data to decode, I have at least one valid frame.
From the reported processed end position, I know how many data I can remove from the buffer.
ps. I admit that the implementation is a bit messy and I would do it differently today because I could use functionality from the AudioTools that were just not available yet, when this has been implemented.