I'm doing kind of flac parser and I need to parse header of each frame. There is one field described in flac format (https://xiph.org/flac/format.html#frame_header)
if(variable blocksize) <8-56>:"UTF-8" coded sample number (decoded number is 36 bits) [4] else <8-48>:"UTF-8" coded frame number (decoded number is 31 bits) [4]
and [4] says:
The "UTF-8" coding used for the sample/frame number is the same variable length code used to store compressed UCS-2, extended to handle larger input.
I absolutely can't understand how should I know the size of this field if it is 8-56 or 8-48 bits. Why then decoded number is 36 or 31 bits? Also when I open flac file in hex editor whith UTF-8 encoding there are no numbers in this field. I will be very grateful for any help.