Hi all, this is my first post, I apologize if this question is out of this forum's domain, I am having difficulty finding codec development forums. My hope is that this is a general question that can be answered without much specific knowledge.
I am writing a decoder, decoding SBC (as specificied in the Bluetooth A2DP spec) to PCM16 audio. I have an issue with how to parse the SBC frames, to determine where one frame begins and ends. My understanding is that because with SBC a configuration is contained in EACH frame's header, the configurations are inherently variable and so the frame size is not necessarily consistent throughout one sbc audio file.
That being said, the specification does mention each frame begins with a syncword, 0x9C. So my implementation, in an attempt to extract a single frame from a file, basically inspects the next byte for the expected syncword (0x9C), and then searches for the NEXT syncword, and assumes everything inbetween to be one frame.
This of course means that should 0x9C happen to be part of the data at any point, my algorithm will produce bad results, returning a short frame and corrupting the data.
So my questions are:
Is it safe to assume the syncword 0x9C will never be part of the data? I already think by inspection of my test files that the answer to this is no.
Is there a better or standard algorithm for parsing frames having knowledge of the syncword? I assume this is a feature other audio formats include as well...how do other codecs do it?
Thanks for any help...even pointing me to a more appropriate forum would be appreciated!
Rich