Shaunwei / RealChar

🎙️🤖Create, Customize and Talk to your AI Character/Companion in Realtime (All in One Codebase!). Have a natural seamless conversation with AI everywhere (mobile, web and terminal) using LLM OpenAI GPT3.5/4, Anthropic Claude2, Chroma Vector DB, Whisper Speech2Text, ElevenLabs Text2Speech🎙️🤖
https://RealChar.ai/
MIT License
6.01k stars 734 forks source link

Playing TTS Stream Chunks #278

Open TomExMachina opened 1 year ago

TomExMachina commented 1 year ago

I see in your code you are using the elevenlabs stream option, and sending chunks to the client via websockets. However, it seems like (By testing) that your web player is not beginning playback until the entire audio clips from elevenlabs has been received by the client. Am I correct about that? I am trying to solve the same problem.

pycui commented 1 year ago

yes. The chunk we are using is already a subset of the full response, so maybe not a big issue. You can change to other streaming-based audio output web API -- feel free to contribute if you find it work