Kokoro-FastAPI icon indicating copy to clipboard operation
Kokoro-FastAPI copied to clipboard

let ffmpeg handle speed-up/down, kokoro generates at 1.0x

Open working-name opened this issue 1 month ago • 7 comments

Describe the feature you'd like Can you please use ffmpeg to process speed? That way kokoro doesn't botch pronunciation or skip words.

Describe alternatives you've considered I've already done this with claude but it's hacky and ugly. However, it works extremely well.

Additional context This would make kokoro useful in more scenarios.

working-name avatar Oct 26 '26 01:10 working-name

Hi! I’d love to work on this issue. I think using FFmpeg’s audio speed adjustment could be a good approach to change playback speed while preserving Kokoro’s pronunciation quality and avoiding skipped words.

I’d be happy to investigate the existing implementation, explore a clean integration, and submit a PR with appropriate testing. Could you please assign this issue to me? Thanks!

Himansh133 avatar Oct 26 '26 21:10 Himansh133

  1. Hi! I’d love to work on this issue. I think using FFmpeg’s audio speed adjustment could be a good approach to change playback speed while preserving Kokoro’s pronunciation quality and avoiding skipped words. I’d be happy to investigate the existing implementation, explore a clean integration, and submit a PR with appropriate testing. Could you please assign this issue to me? Thanks!

Sounds awesome! Here's the very heavy/hacky implementation I use. Emphasis on heavy. https://github.com/working-name/kokoro-hacky

working-name avatar Oct 27 '26 18:10 working-name

Hey @Himansh133, that would be great, thanks! Feel free to open a draft PR early and tag me if you have any questions. Preferences below:

  • Gating on a server setting like SPEED_MODE=model|stretch, defaulting to model so existing behavior stays the same at first (we can promote it afterwards).
  • PyAV is already a dep and bundles ffmpeg; I think the atempo filter might do the trick without having to call out to ffmpeg separately, but would need to be checked to work with streaming.

remsky avatar Oct 30 '26 02:10 remsky

I'm on it. I'll draft a pr as early as possible.

Himansh133 avatar Oct 30 '26 04:10 Himansh133

@Himansh133 if you are able to, I would appreciate an option for volume normalization too. Some voices are less loud than others, and they're all soft overall.

working-name avatar Oct 31 '26 18:10 working-name

+1

RBEmerson970 avatar Oct 31 '26 18:10 RBEmerson970

alr, I'm on it.

Himansh133 avatar Oct 31 '26 21:10 Himansh133