-
Notifications
You must be signed in to change notification settings - Fork 15
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
End-to-end sample code for streaming text-to-speech #48
Comments
Thanks for sharing, this should be part of original documentation. |
Has anyone tested this on iPhone? |
Thanks so much for sharing your solution and flagging the current docs as lacking. Unfortunately, I'm not able to successfully get your solution working, due to this error:
In any case, this is a brick wall for many developers looking to incorporate the streaming API from Eleven Labs. I hope more attention is given to this part of the documentation. |
I created a simple example of streaming generated text from server to client in a NextJS app. You can find it here: https://github.com/jtmuller5/elevenlabs-nextjs-stream-example Important parts:
|
Issue
Understanding how to stream and play the generated audio isn't very straightforward for devs who are new to streaming and playing audio.
Expected
Clear sample code showing an end-to-end example or having convenience methods within this JS lib that helps people stream and play audio both for server- and client-side needs.
Example code
For now, here is some sample code others can work off of (and hopefully improve upon)
Text-to-Speech (server-side)
API Route to wrap it (since this ElevenLabs lib works only in Node envs for now)
Hook to call into API route
Audio player to play streamed readable
React code to bring it all together
The text was updated successfully, but these errors were encountered: