Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio chunk leakage between streams #230

Open
phamson02 opened this issue Dec 9, 2024 · 2 comments
Open

Audio chunk leakage between streams #230

phamson02 opened this issue Dec 9, 2024 · 2 comments

Comments

@phamson02
Copy link

I'm working on a server to generate audio using the Coqui engine. I've initialised a single instance of CoquiEngine. For each synthesise request, I create a TextToAudioStream object using this initialised CoquiEngine. I've noticed that with concurrent requests, audio chunks are leaking into the wrong streams. Is this behaviour expected with Coqui?

@phamson02 phamson02 changed the title Audio chunk leakage between requests Audio chunk leakage between streams Dec 9, 2024
@SreevaatsavB
Copy link

Facing the same issue here, keen to understand about how to handle concurrent requests. In sesne, the process of stopping the on-going generation of audio chunks, terminating it so that no more chunks will be generated and sent to client and then starting a new process for new text input.

@KoljaB
Copy link
Owner

KoljaB commented Jan 8, 2025

Oh, my bad for missing this earlier!

This issue relates to (code example)

In short, you can't use the same engine for multiple concurrent requests because they'd all end up writing to the same audio queue. To handle true concurrent synthesis, you’ll need multiple engine instances.

With local engines this means way more VRAM usage. There's no way around that for proper concurrent inference. TTS is super resource-heavy, so you'll need a fast GPU, and the engine setup has to be spot-on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants