Skip to content
Discussion options

You must be logged in to vote

Yes. For the standard FunASR AutoModel.generate() result, timestamps are in milliseconds, so divide both boundaries by 1000.0.

For character/word timestamps:

result = model.generate(input="audio.wav")
item = result[0]

timestamps_seconds = [
    [start_ms / 1000.0, end_ms / 1000.0]
    for start_ms, end_ms in item.get("timestamp", [])
]

For VAD/speaker sentence segments:

sentences_seconds = [
    {
        **segment,
        "start": segment["start"] / 1000.0,
        "end": segment["end"] / 1000.0,
    }
    for segment in item.get("sentence_info", [])
]

For example, [1230, 2480] becomes [1.23, 2.48] seconds. Keep the original millisecond values if you need integer subtitle or alignment …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by LauraGPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants