Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.
def amrPayload2Storage_OctetAlignedMode(payload): try: # assume no interleaving, CRCs or bit re-ordering bitlen = [95,103,118,134,148,159,204,244,39] amr = BitArray(bytes=payload) cmr = amr[0:4] res = amr[4:8] assert res.uint==0,'amr[4:8] must be zero' f = amr mode = amr[9:13] qual = amr[13:14] pad = amr[14:16] if mode.uint >=0 and mode.uint <= 8: assert amr.len >= 16+bitlen[mode.uint] voice = amr[16:16+bitlen[mode.uint]] storage = BitArray(bin='0') storage.append(mode) storage.append(qual) storage.append('0b00') # padding assert storage.len==8,"check length of storage header is one byte" storage.append(voice) return storage.tobytes() except: import pdb # pdb.pm() # or pdb.post_mortem() pdb.set_trace() return ''
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.