ldc_bpcsad.io
.write_audacity_label_file
- ldc_bpcsad.io.write_audacity_label_file(fpath, segs, rec_dur=None, is_sorted=False, precision=2)[source]
Write speech segments to Audacity label file.
The resulting file will contain alternating speech/non-speech segments.
- Parameters:
fpath (pathlib.Path) – Path to file in Audacity label file format.
segs (Iterable[Segment]) – Speech segments.
rec_dur (float, optional) – Recording duration in seconds. Used to set boundary of final non-speech segment. If None, set to
segs[-1].offset
. (Default: None)is_sorted (bool, optional) – If True, treat segs as already sorted. Otherwise, sort before writing. (Default: False)
precision (int, optional) – Output will be truncated to precision decimal places. (Default: 2)
Notes
https://manual.audacityteam.org/man/importing_and_exporting_labels.html