mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 08:50:41 +00:00
Documentation
This commit is contained in:
@@ -14,7 +14,10 @@ instance of :class:`WaveInfoReader`.
|
||||
path = 'path/to/your/wave/audio.wav'
|
||||
|
||||
info = wavinfo.WavInfoReader(path)
|
||||
|
||||
|
||||
adm_metadata = info.adm
|
||||
ixml_metadata = info.ixml
|
||||
|
||||
|
||||
.. module:: wavinfo
|
||||
:noindex:
|
||||
|
||||
@@ -7,6 +7,6 @@ See the documentation for `wavinfo.WavInfoReader` for more information.
|
||||
from .wave_reader import WavInfoReader
|
||||
from .riff_parser import WavInfoEOFError
|
||||
|
||||
__version__ = '2.1.0'
|
||||
__version__ = '2.1.1'
|
||||
__author__ = 'Jamie Hardt <jamiehardt@gmail.com>'
|
||||
__license__ = "MIT"
|
||||
|
||||
@@ -42,7 +42,7 @@ def main():
|
||||
raise MissingDataError("adm")
|
||||
elif options.ixml:
|
||||
if this_file.ixml:
|
||||
sys.stdout.write(this_file.ixml.xml_bytes())
|
||||
sys.stdout.write(this_file.ixml.xml_str())
|
||||
else:
|
||||
raise MissingDataError("ixml")
|
||||
else:
|
||||
|
||||
@@ -53,7 +53,7 @@ class WavADMReader:
|
||||
|
||||
def programme(self) -> dict:
|
||||
"""
|
||||
Extract the ADM audioProgramme data structure and some of its reference properties
|
||||
Read the ADM `audioProgramme` data structure and some of its reference properties.
|
||||
"""
|
||||
ret_dict = dict()
|
||||
|
||||
@@ -95,7 +95,7 @@ class WavADMReader:
|
||||
|
||||
return ret_dict
|
||||
|
||||
def track_info(self, index):
|
||||
def track_info(self, index) -> dict:
|
||||
"""
|
||||
Information about a track in the WAV file.
|
||||
|
||||
@@ -151,7 +151,7 @@ class WavADMReader:
|
||||
|
||||
return ret_dict
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self) -> dict: #FIXME should be "asdict"
|
||||
"""
|
||||
Get ADM metadata as a dictionary.
|
||||
"""
|
||||
|
||||
@@ -598,7 +598,7 @@ class WavDolbyMetadataReader:
|
||||
return retval
|
||||
|
||||
|
||||
def __init__(self, dbmd_data) -> None:
|
||||
def __init__(self, dbmd_data):
|
||||
self.segment_list = []
|
||||
|
||||
h = BytesIO(dbmd_data)
|
||||
|
||||
@@ -59,7 +59,7 @@ class WavInfoChunkReader:
|
||||
else:
|
||||
return None
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self) -> dict: #FIXME should be asdict
|
||||
"""
|
||||
A dictionary with all of the key/values read from the INFO scope.
|
||||
"""
|
||||
|
||||
@@ -27,7 +27,7 @@ class WavIXMLFormat:
|
||||
else:
|
||||
return None
|
||||
|
||||
def xml_bytes(self):
|
||||
def xml_str(self) -> str:
|
||||
return ET.tostring(self.parsed).decode("utf-8")
|
||||
|
||||
@property
|
||||
@@ -41,7 +41,8 @@ class WavIXMLFormat:
|
||||
def track_list(self):
|
||||
"""
|
||||
A description of each track.
|
||||
:returns: An Iterator
|
||||
|
||||
:yields: `IXMLTrack` for each track.
|
||||
"""
|
||||
for track in self.parsed.find("./TRACK_LIST").iter():
|
||||
if track.tag == 'TRACK':
|
||||
|
||||
Reference in New Issue
Block a user