espnet2.fileio.rttm.RttmReader
Less than 1 minute
espnet2.fileio.rttm.RttmReader
class espnet2.fileio.rttm.RttmReader(fname: str)
Bases: Mapping
Reader class for ‘rttm.scp’.
Examples
SPEAKER file1 1 0 1023 <NA> <NA> spk1 <NA> SPEAKER file1 2 4000 3023 <NA> <NA> spk2 <NA> SPEAKER file1 3 500 4023 <NA> <NA> spk1 <NA> END file1 <NA> 4023 <NA> <NA> <NA> <NA>
This is an extend version of standard RTTM format for espnet. The difference including:
- Use sample number instead of absolute time
- has a END label to represent the duration of a recording
- replace duration (5th field) with end time (For standard RTTM,
see https://catalog.ldc.upenn.edu/docs/LDC2004T12/RTTM-format-v13.pdf)
…
>>> reader = RttmReader('rttm')
>>> spk_label = reader["file1"]
keys() → a set-like object providing a view on D's keys