Kokoro-FastAPI
Kokoro-FastAPI copied to clipboard
Opus output format issue: the last a few seconds is missing.
Test text:
This is the first paragraph. And this is the second sentence.
This is the second paragraph. And this is the forth sentence.
Tested format:
- wav ✅
- mp3 ✅
- flac ✅
- aac ✅
- opus ❌ -> The last part
d this is the forth sentenceis missing in the opus output.
I believe the bug is in the StreamingAudioWriter (api/src/services/streaming_audio_writer.py). Opus caches a few frames in the buffer to do compression, but somehow the finalize=true does not flush the audio buffer.
Currently, I think we can simply disable opus output. Because ususally people use opus when they want minimal file size. I can use ffmpeg locally to convert lossless wav to opus.
Has it ever worked?
You're not suggesting removing Opus support from the API are you?
It's used for streaming to Voice Assistants.
same problem