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
评论列表
文章目录