vtt¶
VTT I/O module.
Functions
Converts floating point seconds into timestamp string. |
|
Converts timestamp string into floating point seconds. |
Classes
- class VTTReader[source]¶
Bases:
object
Safe VTT subtitle reader.
- class VTTWriter[source]¶
Bases:
object
Safe VTT subtitle writer.
- static check(path, overwrite=False)[source]¶
Checks that a file has of the correct extension and verifies that we can overwrite it if it exists.
- Parameters:
path (
Union
[str
,Path
]) – Path to the file.overwrite (bool)
- Returns:
- static write(segments, path, overwrite=False, verbose=True)[source]¶
Writes transcribed audio segments into a VTT subtitle file.
- Parameters:
segments (
Sequence
[Dict
[str
,Union
[str
,float
]]]) – Transcribed audio segments.path (
Union
[str
,Path
]) – Path to the file.overwrite (
bool
) – Whether to overwrite, in case of an existing file.verbose (
bool
) – Verbosity of the method.
- Returns: