let ffmpeg handle speed-up/down, kokoro generates at 1.0x
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.
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!
- 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
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 tomodelso existing behavior stays the same at first (we can promote it afterwards). - PyAV is already a dep and bundles ffmpeg; I think the
atempofilter might do the trick without having to call out to ffmpeg separately, but would need to be checked to work with streaming.
I'm on it. I'll draft a pr as early as possible.
@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.
+1
alr, I'm on it.