mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 08:50:41 +00:00
Steinberg tests and implementation ip
This commit is contained in:
@@ -112,8 +112,11 @@ class TestWaveInfo(TestCase):
|
||||
assert info.ixml.steinberg is not None
|
||||
self.assertIsNotNone(info.ixml.steinberg.audio_speaker_arrangement)
|
||||
self.assertEqual(info.ixml.steinberg.sample_format_size, 3)
|
||||
self.assertEqual(info.ixml.steinberg.media_company, "https://github.com/iluvcapra/wavinfo")
|
||||
self.assertFalse(info.ixml.steinberg.media_drop_frames)
|
||||
self.assertEqual(info.ixml.steinberg.media_duration, 1200.0)
|
||||
|
||||
def test_metadata(self):
|
||||
def test_info_metadata(self):
|
||||
file_with_metadata = 'tests/test_files/sound_grinder_pro/new_camera bumb 1.wav'
|
||||
self.assertTrue(os.path.exists(file_with_metadata))
|
||||
info = wavinfo.WavInfoReader(file_with_metadata).info
|
||||
|
||||
@@ -75,8 +75,6 @@ class SteinbergMetadata:
|
||||
val = self.parsed.find("./ATTR_LIST/ATTR[NAME = 'AudioSpeakerArrangement']/VALUE")
|
||||
if val is not None:
|
||||
return type(self).AudioSpeakerArrangement(int(val.text))
|
||||
else:
|
||||
return None
|
||||
|
||||
@property
|
||||
def sample_format_size(self) -> Optional[int]:
|
||||
@@ -86,29 +84,33 @@ class SteinbergMetadata:
|
||||
val = self.parsed.find("./ATTR_LIST/ATTR[NAME = 'AudioSampleFormatSize']/VALUE")
|
||||
if val is not None:
|
||||
return int(val.text)
|
||||
else:
|
||||
return None
|
||||
|
||||
@property
|
||||
def media_company(self) -> Optional[str]:
|
||||
"""
|
||||
MediaCompany
|
||||
"""
|
||||
pass
|
||||
val = self.parsed.find("./ATTR_LIST/ATTR[NAME = 'MediaCompany']/VALUE")
|
||||
if val is not None:
|
||||
return val.text
|
||||
|
||||
@property
|
||||
def media_drop_frames(self) -> Optional[bool]:
|
||||
"""
|
||||
MediaDropFrames
|
||||
"""
|
||||
pass
|
||||
val = self.parsed.find("./ATTR_LIST/ATTR[NAME = 'MediaDropFrames']/VALUE")
|
||||
if val is not None:
|
||||
return val.text == "1"
|
||||
|
||||
@property
|
||||
def media_duration(self) -> Optional[float]:
|
||||
"""
|
||||
MediaDuration
|
||||
"""
|
||||
pass
|
||||
val = self.parsed.find("./ATTR_LIST/ATTR[NAME = 'MediaDuration']/VALUE")
|
||||
if val is not None:
|
||||
return float(val.text)
|
||||
|
||||
@property
|
||||
def media_start_time(self) -> Optional[float]:
|
||||
|
||||
Reference in New Issue
Block a user