Load annotations from a TIMIT[1]_ transcription file.
Parameters:
annot_path (str, pathlib.Path) – Path to a TIMIT transcription file,
with one of the extensions {‘.phn’, ‘.PHN’, ‘.wrd’, ‘.WRD’}.
audio_path (str, pathlib.Path) – Optional, defaults to annot_path with the extension
changed to ‘.wav’ or ‘.WAV’. Both extensions are checked
and if either file exists, that one is used. Otherwise,
defaults to ‘.wav’ in lowercase.
round_times (bool) – If True, round onsets_s and offsets_s.
Default is True.
decimals (int) – Number of decimals places to round floating point numbers to.
Only meaningful if round_times is True.
Default is 3, so that times are rounded to milliseconds.
samplerate (int) – Sampling rate for wave files. Used to convert
begin_samples and end_samples
from sample number to seconds.
Default is None, in which ths function
tries to open audio_path and determine
the actual sampling rate. If this does not work,
then the onsets_s and offsets_s attributes
of the crowsetta.Sequence are left as None.
The round_times and decimals arguments are provided
to reduce differences across platforms
due to floating point error, e.g. when loading annotation files
and then sending them to a csv file,
the result should be the same on Windows and Linux.
Make a phn file in the TIMIT format
from this instance.
Parameters:
annot_path (str, pahtlib.Path) – Path including filename where file should be saved.
Must have a valid extension for TIMIT transcription files,
one of {‘.phn’, ‘.PHN’, ‘.wrd’, ‘.WRD’}.
round_times (bool) – if True, round onsets_s and offsets_s.
Default is True.
decimals (int) – number of decimals places to round floating point numbers to.
Only meaningful if round_times is True.
Default is 3, so that times are rounded to milliseconds.
samplerate (int) – Sampling rate for wave files. Used to convert
begin_samples and end_samples
from sample number to seconds.
Default is None, in which ths function
tries to open audio_path and determine
the actual sampling rate. If this does not work,
then the onsets_s and offsets_s attributes
of the crowsetta.Sequence are left as None.
The round_times and decimals arguments are provided
to reduce differences across platforms
due to floating point error, e.g. when loading annotation files
and then sending them to a csv file,
the result should be the same on Windows and Linux.