5. Cue Marker and Range Metadata
5.1. Notes
Cue metadata stores timed markers that clients use to mark times of interest in a wave file, and optionally give them a name and longer comment. Markers can also have an associated length, allowing ranges of times in a file to be marked.
5.1.1. String Encoding of Cue Metadata
Cue labels and notes will be decoded using the string encoding passed to
WavInfoReader's
info_encoding=
parameter, which by default is latin_1
(ISO 8859-1).
Text associated with ltxt
time ranges may specify their own encoding in
the form of a Windows codepage number. wavinfo will attempt to use the
encoding specified.
Note
cset
character set/locale metadata is not supported. If it is present
in the file it will be ignored by wavinfo.
5.2. Class Reference
- class wavinfo.wave_cues_reader.WavCuesReader(cues: List[wavinfo.wave_cues_reader.CueEntry], labels: List[wavinfo.wave_cues_reader.LabelEntry], ranges: List[wavinfo.wave_cues_reader.RangeLabel], notes: List[wavinfo.wave_cues_reader.LabelEntry])
-
- each_cue() Generator[Tuple[int, int], None, None]
Iterate through each cue.
- Yields:
the cue’s
name
andsample_offset
- label_and_note(cue_ident: int) Tuple[str | None, str | None]
Get the label and note (extended comment) for a cue.
- Parameters:
cue_ident – the cue’s name, its unique identifying number
- Returns:
a tuple of the the cue’s label (if present) and note (if present)
- labels: List[LabelEntry]
Every
labl
in the file
- notes: List[LabelEntry]
Every
note
in the file
- range(cue_ident: int) int | None
Get the length of the time range for a cue, if it has one.
- Parameters:
cue_ident – the cue’s name, its unique identifying number
- Returns:
the length of the marker’s range, or None
- ranges: List[RangeLabel]
Every
ltxt
in the file
- class wavinfo.wave_cues_reader.CueEntry(name: int, position: int, chunk_id: bytes, chunk_start: int, block_start: int, sample_offset: int)
A
cue
element structure.- block_start: int
Alias for field number 4
- chunk_id: bytes
Alias for field number 2
- chunk_start: int
Alias for field number 3
- name: int
Cue “name” or id number
- position: 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.
- sample_offset: int
Alias for field number 5
- class wavinfo.wave_cues_reader.LabelEntry(name: int, text: str)
A
labl
structure.- name: int
Alias for field number 0
- text: str
Alias for field number 1
- wavinfo.wave_cues_reader.NoteEntry
alias of
LabelEntry