vikit.common.subtitle_tools =========================== .. py:module:: vikit.common.subtitle_tools Overview -------- .. list-table:: Function :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`trim_subtitles `\ (subtitles, start_time_sec, end_time_sec) - Trim the subtitles to the specified time range and shift their timing to begin Functions --------- .. py:function:: trim_subtitles(subtitles: pysrt.SubRipFile, start_time_sec: float, end_time_sec: float) -> pysrt.SubRipFile Trim the subtitles to the specified time range and shift their timing to begin at 0 seconds. :param subtitles: The subtitles to preprocess. :param start_time_sec: The start time (in seconds) of the desired range. :param end_time_sec: The end time (in seconds) of the desired range. :returns: A `SubRipFile` object containing the trimmed subtitles. Possibly empty.