meta_events.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:midi 作者: MicroTransactionsMatterToo 项目源码 文件源码
def sequence_number(data: Union[FileIO, BufferedReader]) -> Tuple[int, int, bytearray]:
    length_bytes = bytearray(data.read(4))
    length = int.from_bytes(length_bytes, "big")
    if length != 2:
        raise EventLengthError("Sequence Number length was incorrect. It should be 2, but it was {}".format(length))
    sequence_num_raw = bytearray(data.read(2))
    sequence_num = int.from_bytes(sequence_num_raw, "big")
    return length, sequence_num, sequence_num_raw
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号