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 stream from a POST call #201

Open
Bilal-io opened this issue Jul 22, 2024 · 1 comment
Open

Audio stream from a POST call #201

Bilal-io opened this issue Jul 22, 2024 · 1 comment

Comments

@Bilal-io
Copy link

I am curious if there is a way to use the player by providing a ReadableStream instead of an endpoint like it's shown in the demo.

My goal is to make a POST call with a payload to a backend that does TTS then provides a chunked response.

@eshaz
Copy link
Owner

eshaz commented Jul 24, 2024

There is currently no way to provide your own ReadableStream, vs. having the library make the HTTP request for you. I'm not sure it would be possible to add this functionality since it would break some of the reconnect logic that relies on being able to create new ReadableStreams (i.e. connections) based on a stream URL. Also, a POST request to get the streaming audio is not Icecast compatible, and I don't plan on adding that functionality. The request to get the streaming data should always be a GET request.

You can get this to work as-is by changing your backend / design to provide an Icecast compatible stream URL that works with a GET request, then use that to instantiate the player.

What's TTS? Text to speech?

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