mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 17:00:41 +00:00
Merge pull request #25 from iluvcapra/maint-docs
More Documentation Improvements: cues
This commit is contained in:
@@ -24,12 +24,15 @@ source for all WAVE file metadata.
|
|||||||
* [iXML][ixml] production recorder metadata, including project, scene, and
|
* [iXML][ixml] production recorder metadata, including project, scene, and
|
||||||
take tags, recorder notes and file family information.
|
take tags, recorder notes and file family information.
|
||||||
* iXML `STEINBERG` sound library attributes.
|
* iXML `STEINBERG` sound library attributes.
|
||||||
* Wave embedded cue markers, cue marker labels, notes and timed ranges as used
|
* Wave embedded [cue markers][cues], cue marker labels, notes and timed ranges as used
|
||||||
by Zoom, iZotope RX, etc.
|
by Zoom, iZotope RX, etc.
|
||||||
* Most of the common [RIFF INFO][info-tags] metadata fields.
|
* Most of the common [RIFF INFO][info-tags] metadata fields.
|
||||||
* The __wav format__ is also parsed, so you can access the basic sample rate
|
* The [wav format][format] is also parsed, so you can access the basic sample rate
|
||||||
and channel count information.
|
and channel count information.
|
||||||
|
|
||||||
|
|
||||||
|
[format]:https://wavinfo.readthedocs.io/en/latest/classes.html#wavinfo.wave_reader.WavAudioFormat
|
||||||
|
[cues]:https://wavinfo.readthedocs.io/en/latest/scopes/cue.html
|
||||||
[bext]:https://wavinfo.readthedocs.io/en/latest/scopes/bext.html
|
[bext]:https://wavinfo.readthedocs.io/en/latest/scopes/bext.html
|
||||||
[smpte_330m2011]:https://wavinfo.readthedocs.io/en/latest/scopes/bext.html#wavinfo.wave_bext_reader.WavBextReader.umid
|
[smpte_330m2011]:https://wavinfo.readthedocs.io/en/latest/scopes/bext.html#wavinfo.wave_bext_reader.WavBextReader.umid
|
||||||
[adm]:https://wavinfo.readthedocs.io/en/latest/scopes/adm.html
|
[adm]:https://wavinfo.readthedocs.io/en/latest/scopes/adm.html
|
||||||
|
|||||||
@@ -29,3 +29,12 @@ Class Reference
|
|||||||
|
|
||||||
.. autoclass:: wavinfo.wave_cues_reader.WavCuesReader
|
.. autoclass:: wavinfo.wave_cues_reader.WavCuesReader
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: wavinfo.wave_cues_reader.CueEntry
|
||||||
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: wavinfo.wave_cues_reader.LabelEntry
|
||||||
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: wavinfo.wave_cues_reader.NoteEntry
|
||||||
|
:members:
|
||||||
|
|||||||
@@ -98,7 +98,14 @@ LanguageDialectCodes = """0 0 None Indicated
|
|||||||
|
|
||||||
|
|
||||||
class CueEntry(NamedTuple):
|
class CueEntry(NamedTuple):
|
||||||
|
"""
|
||||||
|
A ``cue`` element structure.
|
||||||
|
"""
|
||||||
|
#: Cue "name" or id number
|
||||||
name: int
|
name: int
|
||||||
|
#: Cue position, as a frame count in the play order of the WAVE file. In
|
||||||
|
#: principle this can be affected by playlists and ``wavl`` chunk
|
||||||
|
#: placement.
|
||||||
position: int
|
position: int
|
||||||
chunk_id: bytes
|
chunk_id: bytes
|
||||||
chunk_start: int
|
chunk_start: int
|
||||||
@@ -114,7 +121,8 @@ class CueEntry(NamedTuple):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def read(cls, data: bytes) -> 'CueEntry':
|
def read(cls, data: bytes) -> 'CueEntry':
|
||||||
assert len(data) == cls.format_size(), \
|
assert len(data) == cls.format_size(), \
|
||||||
f"cue data size incorrect, expected {calcsize(cls.Format)} found {len(data)}"
|
(f"cue data size incorrect, expected {calcsize(cls.Format)}"
|
||||||
|
"found {len(data)}")
|
||||||
|
|
||||||
parsed = unpack(cls.Format, data)
|
parsed = unpack(cls.Format, data)
|
||||||
|
|
||||||
@@ -124,6 +132,9 @@ class CueEntry(NamedTuple):
|
|||||||
|
|
||||||
|
|
||||||
class LabelEntry(NamedTuple):
|
class LabelEntry(NamedTuple):
|
||||||
|
"""
|
||||||
|
A ``labl`` structure.
|
||||||
|
"""
|
||||||
name: int
|
name: int
|
||||||
text: str
|
text: str
|
||||||
|
|
||||||
@@ -137,6 +148,9 @@ NoteEntry = LabelEntry
|
|||||||
|
|
||||||
|
|
||||||
class RangeLabel(NamedTuple):
|
class RangeLabel(NamedTuple):
|
||||||
|
"""
|
||||||
|
A ``ltxt`` structure.
|
||||||
|
"""
|
||||||
name: int
|
name: int
|
||||||
length: int
|
length: int
|
||||||
purpose: str
|
purpose: str
|
||||||
@@ -163,9 +177,17 @@ class RangeLabel(NamedTuple):
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class WavCuesReader:
|
class WavCuesReader:
|
||||||
|
|
||||||
|
#: Every ``cue`` entry in the file
|
||||||
cues: List[CueEntry]
|
cues: List[CueEntry]
|
||||||
|
|
||||||
|
#: Every ``labl`` in the file
|
||||||
labels: List[LabelEntry]
|
labels: List[LabelEntry]
|
||||||
|
|
||||||
|
#: Every ``ltxt`` in the file
|
||||||
ranges: List[RangeLabel]
|
ranges: List[RangeLabel]
|
||||||
|
|
||||||
|
#: Every ``note`` in the file
|
||||||
notes: List[NoteEntry]
|
notes: List[NoteEntry]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user