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

streaming smooth #124

Open
cesinsingapore opened this issue Aug 30, 2024 · 3 comments
Open

streaming smooth #124

cesinsingapore opened this issue Aug 30, 2024 · 3 comments

Comments

@cesinsingapore
Copy link

i tried to create streaming sample here

https://gist.github.com/cesinsingapore/5147b0fcd63ba6aa22e0faa1a52ba249

but the problem is there is not smooth enough playing between chunks, anyone can make it smooth?

@haixuanTao
Copy link

So, if you hear sudden blank, it means that the generation is not fast enough to play it in one go. You could try to either:

  • Wait before generating the first audio and correlate the wait time with the generation length
  • Try to improve generation with things like: torch.compile()

@cesinsingapore
Copy link
Author

cesinsingapore commented Aug 30, 2024

So, if you hear sudden blank, it means that the generation is not fast enough to play it in one go. You could try to either:

  • Wait before generating the first audio and correlate the wait time with the generation length
  • Try to improve generation with things like: torch.compile()

I'm not experiencing sudden blank, but between chunk generated there is like a static signal voice(just call it like a noise), idk what is it in english, is that same reason as the first point ?

@haixuanTao
Copy link

Yeah, not too sure. It could be coming from sounddevice. Could you try to record the audio in an audio file to see if it is still there when you play it ?

I switched to PyAudio for streaming on first audio. Maybe it could help.

FYI, 我也能说中文

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

2 participants