ldc_bpcsad.io.load_htk_label_file

ldc_bpcsad.io.load_htk_label_file(fpath, target_labels=None, ignored_labels=None, in_sec=True)[source]

Load speech segments from HTK label file.

If both target_labels and ignore_labels are unset, then all segments in fpath will be considered speech segments. If target_labels is set, then only segments from fpath with a label in target_labels will be returned. If ignored_labels is set, then only segments from fpath with a label NOT in ignore_labels will be returned.

Parameters:
  • fpath (pathlib.Path) – Path to file in HTK label file format.

  • target_labels (Iterable[str], optional) – Target labels. All segments in fpath with with one of these labels will be considered speech segments. (Default: None)

  • ignored_labels (Iterable[str], optional) – Labels to ignore. Output will be filtered so that segments with a label from this set will be skipped. If None, then no filtering is performed. (Default: None)

  • in_sec (bool, optional) – If True, interpret onsets/offsets within fpath as measuring seconds. Else, interpret as measuring HTK 100 ns units. (Default: True)

Returns:

Speech segments.

Return type:

List[Segment]

References