meta_events.py 文件源码

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

项目:midi 作者: MicroTransactionsMatterToo 项目源码 文件源码
def set_tempo(data: Union[FileIO, BufferedReader]) -> Tuple[int, int, bytearray]:
    length_bytes = data.read(4)
    length = int.from_bytes(length_bytes, "big")
    if length != 3:
        raise EventLengthError("Set Tempo event with length other than 3. Given length was {}".format(length))
    raw_data = bytearray(data.read(3))
    tpqm = int.from_bytes(raw_data, "big")

    return length, tpqm, raw_data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号