How to use the asrtoolkit.data_structures.formatting.seconds_to_timestamp function in asrtoolkit

To help you get started, we’ve selected a few asrtoolkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github finos / greenkey-asrtoolkit / asrtoolkit / data_handlers / vtt.py View on Github external
def format_segment(seg):
    """
    Formats a segment assuming it's an instance of class segment with elements
    filename, channel, speaker, start and stop times, label, and text
    """

    ret_str = "{:} --> {:}".format(seconds_to_timestamp(seg.start),
                                   seconds_to_timestamp(seg.stop))
    ret_str += " ".format(seg.channel)
    ret_str += " ".format(seg.speaker)
    ret_str += "\n{:}\n".format(
        seg.formatted_text if seg.formatted_text else seg.text)

    return ret_str
github finos / greenkey-asrtoolkit / asrtoolkit / data_handlers / srt.py View on Github external
def format_segment(seg):
    """
    Formats a segment assuming it's an instance of class segment with elements
    filename, channel, speaker, start and stop times, label, and text
    """

    ret_str = "1\n{:} --> {:}\n".format(seconds_to_timestamp(seg.start),
                                        seconds_to_timestamp(
                                            seg.stop)).replace(".", ",")
    ret_str += "{:}\n\n".format(
        seg.formatted_text if seg.formatted_text else seg.text)

    return ret_str
github finos / greenkey-asrtoolkit / asrtoolkit / data_handlers / srt.py View on Github external
def format_segment(seg):
    """
    Formats a segment assuming it's an instance of class segment with elements
    filename, channel, speaker, start and stop times, label, and text
    """

    ret_str = "1\n{:} --> {:}\n".format(seconds_to_timestamp(seg.start),
                                        seconds_to_timestamp(
                                            seg.stop)).replace(".", ",")
    ret_str += "{:}\n\n".format(
        seg.formatted_text if seg.formatted_text else seg.text)

    return ret_str
github finos / greenkey-asrtoolkit / asrtoolkit / data_handlers / vtt.py View on Github external
def format_segment(seg):
    """
    Formats a segment assuming it's an instance of class segment with elements
    filename, channel, speaker, start and stop times, label, and text
    """

    ret_str = "{:} --> {:}".format(seconds_to_timestamp(seg.start),
                                   seconds_to_timestamp(seg.stop))
    ret_str += " ".format(seg.channel)
    ret_str += " ".format(seg.speaker)
    ret_str += "\n{:}\n".format(
        seg.formatted_text if seg.formatted_text else seg.text)

    return ret_str