mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 08:50:41 +00:00
Base documentation for ADM
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -90,6 +90,7 @@ ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
docs_venv/
|
||||
venv_docs/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
|
||||
@@ -9,12 +9,13 @@ The `wavinfo` package allows you to probe WAVE and [RF64/WAVE files][eburf64] an
|
||||
|
||||
* __Broadcast-WAVE__ metadata<sup>[1][ebu]</sup>, including embedded program
|
||||
loudness and coding history, if extant. This also includes the SMPTE UMID<sup>[2][smpte_330m2011]</sup>.
|
||||
* ADM track metadata<sup>[5][adm]</sup>, including channel, pack formats, object and content names.
|
||||
* __iXML__ production recorder metadata<sup>[3][ixml]</sup>, including project, scene, and take tags, recorder notes
|
||||
and file family information.
|
||||
* Most of the common __RIFF INFO__<sup>[4][info-tags]</sup> metadata fields.
|
||||
* The __wav format__ is also parsed, so you can access the basic sample rate and channel count
|
||||
information.
|
||||
* EBU ADM track metadata<sup>[5][adm]</sup>, including track, channel and pack formats, object and content names.
|
||||
|
||||
|
||||
In progress:
|
||||
* [Dolby RMU][dolby] metadata and [EBU Tech 3285 Supplement 6][ebu3285s6].
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
15
docs/source/metadata_scopes/adm.rst
Normal file
15
docs/source/metadata_scopes/adm.rst
Normal file
@@ -0,0 +1,15 @@
|
||||
ADM (Audio Definition Model) Metadata
|
||||
=====================================
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
||||
|
||||
|
||||
Class Reference
|
||||
---------------
|
||||
|
||||
.. module:: wavinfo
|
||||
|
||||
.. autoclass:: wavinfo.wave_adm_reader.WavADMReader
|
||||
:members:
|
||||
@@ -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 = "<HH"
|
||||
uid_fmt = "<H12s14s11sx"
|
||||
|
||||
#: An :mod:`lxml.etree` of the ADM XML document
|
||||
self.axml = ET.parse(BytesIO(axml_data))
|
||||
|
||||
self.track_count, uid_count = unpack(header_fmt, chna_data[0:4])
|
||||
_, uid_count = unpack(header_fmt, chna_data[0:4])
|
||||
|
||||
#: A list of :class:`ChannelEntry` objects parsed from the
|
||||
#: `chna` metadata chunk.
|
||||
self.channel_uids = []
|
||||
|
||||
offset = calcsize(header_fmt)
|
||||
@@ -33,7 +36,7 @@ class WavADMReader:
|
||||
|
||||
# these values are either ascii or all null
|
||||
|
||||
self.channel_uids.append(WavADMReader.ChannelEntry(track_index,
|
||||
self.channel_uids.append(ChannelEntry(track_index,
|
||||
uid.decode('ascii') , track_ref.decode('ascii'), pack_ref.decode('ascii')))
|
||||
|
||||
offset += calcsize(uid_fmt)
|
||||
|
||||
Reference in New Issue
Block a user