Expand description
read, write, and manipulate HTK .lab label files
use lab_rs::LabFile;
let lab: LabFile = "0 2500000 sil\n2500000 4200000 hh\n".parse()?;
assert_eq!(lab.label_at_secs(0.3).unwrap().text, "hh");times are integers in units of 100ns, parsing is tolerant: start/end times are optional, a trailing numeric score is allowed, and blank lines are ignored
feature flags: serde adds Serialize/Deserialize, cli builds the
lab binary
Structs§
- LabFile
- a parsed
.labfile, derefs toVec<Label> - Label
- a single labelled segment, times are in 100ns units as stored in the
file, use the
*_secsmethods to work in seconds - Parse
Error - an error produced while parsing a
.labfile
Enums§
- Parse
Error Kind - the specific kind of parse failure
- Read
Error - an error produced while reading a .lab from a reader or path
Constants§
- UNITS_
PER_ SECOND - number of HTK time units (100ns) in one second
Functions§
- secs_
to_ units - converts a time in seconds to 100ns units, rounding to nearest
- units_
to_ secs - converts a time in 100ns units to seconds