Module audioio.audiomarkers

Working with marker lists.

Markers are used to mark specific positions or regions in the audio data. Each marker has a position (cue, event), a span, a label, and a text. Position, and span are handled with 1-D or 2-D arrays of ints, where each row is a marker and the columns are position and optional span. Labels and texts come in another 1-D or 2-D array of objects pointing to strings. Again, rows are the markers, first column are the labels, and second column the optional texts. Try to keep the labels short, and use text for longer descriptions.

Functions

def write_markers(fh, locs, labels=None, sep=' ', prefix='')

Write markers to a text file or stream.

Parameters

fh : filename or stream
If not a stream, the file with name fh is opened. Otherwise fh is used as a stream for writing.
locs : 1-D or 2-D array of ints
Marker positions (first column) and optional spans (second column) for each marker (rows).
labels : 1-D or 2-D array of string objects
Labels (first column) and optional texts (second column) for each marker (rows).
sep : str
Column separator.
prefix : str
This string is written at the beginning of each line.
def print_markers(locs, labels=None, sep=' ', prefix='')

Write markers to standard output.

Parameters

locs : 1-D or 2-D array of ints
Marker positions (first column) and optional spans (second column) for each marker (rows).
labels : 1-D or 2-D array of string objects
Labels (first column) and optional texts (second column) for each marker (rows).
sep : str
Column separator.
prefix : str
This string is written at the beginning of each line.