Made sampler udata field nullable

This commit is contained in:
Jamie Hardt
2024-11-24 15:04:00 -08:00
parent a0a9c38cb4
commit d2b0c68dd2

View File

@@ -93,9 +93,12 @@ class WavSmplReader:
repetition_count=unpacked_loop[5]))
#: Sampler-specific user data.
self.sampler_udata: bytes = smpl_data[
header_size + loop_size * loop_count:
header_size + loop_size * loop_count + sampler_udata_length]
self.sampler_udata: bytes | None = None
if sampler_udata_length > 0:
self.sampler_udata = smpl_data[
header_size + loop_size * loop_count:
header_size + loop_size * loop_count + sampler_udata_length]
def to_dict(self):
return {