espnet2.fileio.vad_intervals.VadIntervalsReader
Less than 1 minute
espnet2.fileio.vad_intervals.VadIntervalsReader
class espnet2.fileio.vad_intervals.VadIntervalsReader(fname: Path | str)
Bases: Mapping
Reader of a file of speech intervals, one window per line.
Examples
win1 160000 0 4000 9000 160000 win2 160000
>>> reader = VadIntervalsReader("vad_intervals")
>>> reader["win1"].shape
(160000, 1)Each line is the window length in samples, then pairs of start and end (end exclusive) of speech within the window, each with 0 <= start < end <= length (anything else raises ValueError); intervals may overlap, touch or come in any order. A window without speech has only its length. The label is float32 of shape (length, 1): 1 for speech, 0 elsewhere, the same as RttmReader gives for one speaker.
keys()
The window ids.
