mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 08:50:41 +00:00
Removed UMID parsing for now
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
from functools import reduce
|
||||
# from functools import reduce
|
||||
|
||||
|
||||
def binary_to_string(binary_value):
|
||||
return reduce(lambda val, el: val + "{:02x}".format(el), binary_value, '')
|
||||
# def binary_to_string(binary_value):
|
||||
# return reduce(lambda val, el: val + "{:02x}".format(el), binary_value, '')
|
||||
|
||||
|
||||
class UMIDParser:
|
||||
"""
|
||||
Parse a raw binary SMPTE 330M Universal Materials Identifier
|
||||
|
||||
This implementation is based on SMPTE ST 330:2011
|
||||
"""
|
||||
def __init__(self, raw_umid: bytes):
|
||||
self.raw_umid = raw_umid
|
||||
# class UMIDParser:
|
||||
# """
|
||||
# Parse a raw binary SMPTE 330M Universal Materials Identifier
|
||||
#
|
||||
# This implementation is based on SMPTE ST 330:2011
|
||||
# """
|
||||
# def __init__(self, raw_umid: bytes):
|
||||
# self.raw_umid = raw_umid
|
||||
#
|
||||
# @property
|
||||
# def universal_label(self) -> bytearray:
|
||||
@@ -22,8 +22,8 @@ class UMIDParser:
|
||||
# def basic_umid(self):
|
||||
# return self.raw_umid[0:32]
|
||||
|
||||
def basic_umid_to_str(self):
|
||||
return binary_to_string(self.raw_umid[0:32])
|
||||
# def basic_umid_to_str(self):
|
||||
# return binary_to_string(self.raw_umid[0:32])
|
||||
#
|
||||
# @property
|
||||
# def universal_label_is_valid(self) -> bool:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import struct
|
||||
from .umid_parser import UMIDParser
|
||||
# from .umid_parser import UMIDParser
|
||||
|
||||
from typing import Optional
|
||||
|
||||
@@ -80,11 +80,12 @@ class WavBextReader:
|
||||
self.max_shortterm_loudness = unpacked[12] / 100.0
|
||||
|
||||
def to_dict(self):
|
||||
if self.umid is not None:
|
||||
umid_parsed = UMIDParser(self.umid)
|
||||
umid_str = umid_parsed.basic_umid_to_str()
|
||||
else:
|
||||
umid_str = None
|
||||
# if self.umid is not None:
|
||||
# umid_parsed = UMIDParser(self.umid)
|
||||
# umid_str = umid_parsed.basic_umid_to_str()
|
||||
# else:
|
||||
|
||||
umid_str = None
|
||||
|
||||
return {'description': self.description,
|
||||
'originator': self.originator,
|
||||
|
||||
Reference in New Issue
Block a user