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):
|
# def binary_to_string(binary_value):
|
||||||
return reduce(lambda val, el: val + "{:02x}".format(el), binary_value, '')
|
# return reduce(lambda val, el: val + "{:02x}".format(el), binary_value, '')
|
||||||
|
|
||||||
|
|
||||||
class UMIDParser:
|
# class UMIDParser:
|
||||||
"""
|
# """
|
||||||
Parse a raw binary SMPTE 330M Universal Materials Identifier
|
# Parse a raw binary SMPTE 330M Universal Materials Identifier
|
||||||
|
#
|
||||||
This implementation is based on SMPTE ST 330:2011
|
# This implementation is based on SMPTE ST 330:2011
|
||||||
"""
|
# """
|
||||||
def __init__(self, raw_umid: bytes):
|
# def __init__(self, raw_umid: bytes):
|
||||||
self.raw_umid = raw_umid
|
# self.raw_umid = raw_umid
|
||||||
#
|
#
|
||||||
# @property
|
# @property
|
||||||
# def universal_label(self) -> bytearray:
|
# def universal_label(self) -> bytearray:
|
||||||
@@ -22,8 +22,8 @@ class UMIDParser:
|
|||||||
# def basic_umid(self):
|
# def basic_umid(self):
|
||||||
# return self.raw_umid[0:32]
|
# return self.raw_umid[0:32]
|
||||||
|
|
||||||
def basic_umid_to_str(self):
|
# def basic_umid_to_str(self):
|
||||||
return binary_to_string(self.raw_umid[0:32])
|
# return binary_to_string(self.raw_umid[0:32])
|
||||||
#
|
#
|
||||||
# @property
|
# @property
|
||||||
# def universal_label_is_valid(self) -> bool:
|
# def universal_label_is_valid(self) -> bool:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import struct
|
import struct
|
||||||
from .umid_parser import UMIDParser
|
# from .umid_parser import UMIDParser
|
||||||
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
@@ -80,10 +80,11 @@ class WavBextReader:
|
|||||||
self.max_shortterm_loudness = unpacked[12] / 100.0
|
self.max_shortterm_loudness = unpacked[12] / 100.0
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
if self.umid is not None:
|
# if self.umid is not None:
|
||||||
umid_parsed = UMIDParser(self.umid)
|
# umid_parsed = UMIDParser(self.umid)
|
||||||
umid_str = umid_parsed.basic_umid_to_str()
|
# umid_str = umid_parsed.basic_umid_to_str()
|
||||||
else:
|
# else:
|
||||||
|
|
||||||
umid_str = None
|
umid_str = None
|
||||||
|
|
||||||
return {'description': self.description,
|
return {'description': self.description,
|
||||||
|
|||||||
Reference in New Issue
Block a user