mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2026-01-02 09: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/
|
env.bak/
|
||||||
venv.bak/
|
venv.bak/
|
||||||
docs_venv/
|
docs_venv/
|
||||||
|
venv_docs/
|
||||||
|
|
||||||
# Spyder project settings
|
# Spyder project settings
|
||||||
.spyderproject
|
.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
|
* __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>.
|
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
|
* __iXML__ production recorder metadata<sup>[3][ixml]</sup>, including project, scene, and take tags, recorder notes
|
||||||
and file family information.
|
and file family information.
|
||||||
* Most of the common __RIFF INFO__<sup>[4][info-tags]</sup> metadata fields.
|
* 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
|
* The __wav format__ is also parsed, so you can access the basic sample rate and channel count
|
||||||
information.
|
information.
|
||||||
* EBU ADM track metadata<sup>[5][adm]</sup>, including track, channel and pack formats, object and content names.
|
|
||||||
|
|
||||||
In progress:
|
In progress:
|
||||||
* [Dolby RMU][dolby] metadata and [EBU Tech 3285 Supplement 6][ebu3285s6].
|
* [Dolby RMU][dolby] metadata and [EBU Tech 3285 Supplement 6][ebu3285s6].
|
||||||
|
|||||||
@@ -10,9 +10,10 @@ Welcome to wavinfo's documentation!
|
|||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
:caption: Notes
|
:caption: Notes
|
||||||
|
|
||||||
|
metadata_scopes/adm.rst
|
||||||
metadata_scopes/bext.rst
|
metadata_scopes/bext.rst
|
||||||
metadata_scopes/ixml.rst
|
|
||||||
metadata_scopes/info.rst
|
metadata_scopes/info.rst
|
||||||
|
metadata_scopes/ixml.rst
|
||||||
|
|
||||||
classes
|
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
|
from lxml import etree as ET
|
||||||
|
|
||||||
|
ChannelEntry = namedtuple('ChannelEntry', "track_index uid track_ref pack_ref")
|
||||||
|
|
||||||
class WavADMReader:
|
class WavADMReader:
|
||||||
"""
|
"""
|
||||||
Reads XML data from an EBU ADM (Audio Definiton Model) WAV File.
|
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):
|
def __init__(self, axml_data: bytes, chna_data: bytes):
|
||||||
header_fmt = "<HH"
|
header_fmt = "<HH"
|
||||||
uid_fmt = "<H12s14s11sx"
|
uid_fmt = "<H12s14s11sx"
|
||||||
|
|
||||||
|
#: An :mod:`lxml.etree` of the ADM XML document
|
||||||
self.axml = ET.parse(BytesIO(axml_data))
|
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 = []
|
self.channel_uids = []
|
||||||
|
|
||||||
offset = calcsize(header_fmt)
|
offset = calcsize(header_fmt)
|
||||||
@@ -33,7 +36,7 @@ class WavADMReader:
|
|||||||
|
|
||||||
# these values are either ascii or all null
|
# 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')))
|
uid.decode('ascii') , track_ref.decode('ascii'), pack_ref.decode('ascii')))
|
||||||
|
|
||||||
offset += calcsize(uid_fmt)
|
offset += calcsize(uid_fmt)
|
||||||
|
|||||||
Reference in New Issue
Block a user