Skip to content
Discussion options

You must be logged in to vote

Yes, you can get this straight from Kokoro-FastAPI, no CapCut needed. There's a captioned-speech endpoint that returns word-level timestamps aligned to your original input text, so you skip the auto-caption STT step (and its mistakes) entirely.

Use POST /dev/captioned_speech instead of /v1/audio/speech:

import base64, requests

text = "Hello world! Welcome to the captioned speech system."

r = requests.post(
    "http://localhost:8880/dev/captioned_speech",
    json={
        "model": "kokoro",
        "input": text,
        "voice": "af_heart",
        "speed": 1.0,
        "response_format": "mp3",
        "stream": False,
    },
)
data = r.json()
audio_bytes = base64.b64decode(data["au…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by remsky
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