3 Commits
v1.2 ... v1.3

Author SHA1 Message Date
Jamie Hardt
4dfc1ab33c Added iXML track list parsing 2019-08-19 11:39:13 -07:00
Jamie Hardt
4770c781b2 Update README.md 2019-06-29 21:55:19 -07:00
Jamie Hardt
45c2aae640 Update wave_ixml_reader.py 2019-06-29 21:50:20 -07:00
5 changed files with 37 additions and 2 deletions

View File

@@ -53,6 +53,10 @@ The length of the file in frames (interleaved samples) and bytes is available, a
>>> (48000, 2, 6, 24)
```
## Other Resources
* For other file formats and ID3 decoding, look at [audio-metadata](https://github.com/thebigmunch/audio-metadata).

View File

@@ -4,7 +4,7 @@ with open("README.md", "r") as fh:
long_description = fh.read()
setup(name='wavinfo',
version='1.2',
version='1.3',
author='Jamie Hardt',
author_email='jamiehardt@me.com',
description='Probe WAVE Files for iXML, Broadcast-WAVE and other metadata.',

View File

@@ -87,3 +87,10 @@ class TestWaveInfo(TestCase):
self.assertEqual( e['take'], info.ixml.take )
self.assertEqual( e['tape'], info.ixml.tape )
self.assertEqual( e['family_uid'], info.ixml.family_uid )
for track in info.ixml.track_list:
self.assertIsNotNone(track.channel_index)
if basename == 'A101_4.WAV' and track.channel_index == '1':
self.assertTrue(track.name == 'MKH516 A')

View File

@@ -10,5 +10,5 @@
from .wave_reader import WavInfoReader
__version__ = '1.1'
__version__ = '1.3'
__author__ = 'Jamie Hardt'

View File

@@ -1,6 +1,10 @@
#import xml.etree.ElementTree as ET
from lxml import etree as ET
import io
from collections import namedtuple
IXMLTrack = namedtuple('IXMLTrack', ['channel_index', 'interleave_index', 'name', 'function'])
class WavIXMLFormat:
"""
@@ -27,6 +31,26 @@ class WavIXMLFormat:
if e is not None:
return e.text
@property
def raw_xml(self):
"""
The root entity of the iXML document.
"""
return self.parsed
@property
def track_list(self):
"""
A description of each track.
:return: An Iterator
"""
for track in self.parsed.find("./TRACK_LIST").iter():
if track.tag == 'TRACK':
yield IXMLTrack(channel_index=track.xpath('string(CHANNEL_INDEX/text())'),
interleave_index=track.xpath('string(INTERLEAVE_INDEX/text())'),
name=track.xpath('string(NAME/text())'),
function=track.xpath('string(FUNCTION/text())'))
@property
def project(self):
"""