From 97bdb2344172b17436102899e450e82ae05d5b2b Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Wed, 23 Nov 2022 14:42:31 -0800 Subject: [PATCH] Base documentation for ADM --- .gitignore | 1 + README.md | 3 ++- docs/source/index.rst | 3 ++- docs/source/metadata_scopes/adm.rst | 15 +++++++++++++++ wavinfo/wave_adm_reader.py | 11 +++++++---- 5 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 docs/source/metadata_scopes/adm.rst diff --git a/.gitignore b/.gitignore index e15bdb3..a9c6ddc 100644 --- a/.gitignore +++ b/.gitignore @@ -90,6 +90,7 @@ ENV/ env.bak/ venv.bak/ docs_venv/ +venv_docs/ # Spyder project settings .spyderproject diff --git a/README.md b/README.md index 2964c1b..99dc5fd 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,13 @@ The `wavinfo` package allows you to probe WAVE and [RF64/WAVE files][eburf64] an * __Broadcast-WAVE__ metadata[1][ebu], including embedded program loudness and coding history, if extant. This also includes the SMPTE UMID[2][smpte_330m2011]. +* ADM track metadata[5][adm], including channel, pack formats, object and content names. * __iXML__ production recorder metadata[3][ixml], including project, scene, and take tags, recorder notes and file family information. * Most of the common __RIFF INFO__[4][info-tags] metadata fields. * The __wav format__ is also parsed, so you can access the basic sample rate and channel count information. -* EBU ADM track metadata[5][adm], including track, channel and pack formats, object and content names. + In progress: * [Dolby RMU][dolby] metadata and [EBU Tech 3285 Supplement 6][ebu3285s6]. diff --git a/docs/source/index.rst b/docs/source/index.rst index c31a7fe..75767e2 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -10,9 +10,10 @@ Welcome to wavinfo's documentation! :maxdepth: 2 :caption: Notes + metadata_scopes/adm.rst metadata_scopes/bext.rst - metadata_scopes/ixml.rst metadata_scopes/info.rst + metadata_scopes/ixml.rst classes diff --git a/docs/source/metadata_scopes/adm.rst b/docs/source/metadata_scopes/adm.rst new file mode 100644 index 0000000..11930dc --- /dev/null +++ b/docs/source/metadata_scopes/adm.rst @@ -0,0 +1,15 @@ +ADM (Audio Definition Model) Metadata +===================================== + +Notes +----- + + + +Class Reference +--------------- + +.. module:: wavinfo + +.. autoclass:: wavinfo.wave_adm_reader.WavADMReader + :members: \ No newline at end of file diff --git a/wavinfo/wave_adm_reader.py b/wavinfo/wave_adm_reader.py index e6918a9..ce12c90 100644 --- a/wavinfo/wave_adm_reader.py +++ b/wavinfo/wave_adm_reader.py @@ -9,21 +9,24 @@ from typing import Iterable, Tuple from lxml import etree as ET +ChannelEntry = namedtuple('ChannelEntry', "track_index uid track_ref pack_ref") + class WavADMReader: """ Reads XML data from an EBU ADM (Audio Definiton Model) WAV File. """ - ChannelEntry = namedtuple('ChannelEntry', "track_index uid track_ref pack_ref") - def __init__(self, axml_data: bytes, chna_data: bytes): header_fmt = "