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

Request for streaming audio from a remote server #3299

Closed
1 task done
arjunbansal opened this issue Feb 23, 2023 · 3 comments
Closed
1 task done

Request for streaming audio from a remote server #3299

arjunbansal opened this issue Feb 23, 2023 · 3 comments

Comments

@arjunbansal
Copy link

Is there a way to stream audio from a remote source such as when using Amazon Polly or Eleven Labs?

There are currently ways to download a full audio file and play it via gr.Audio or an HTML embed, but in streaming demos/applications (real time translation, chatbots) it would be useful to be able to play sound from a streaming remote server rather than waiting to download the whole file.

@abidlabs
Copy link
Member

abidlabs commented Feb 23, 2023

Thanks for your question @arjunbansal. Yes, this should be possible. It kind of depends on your streaming setup, but you could write a generator function and keep yield-ing the output audio file to an Audio output component. See iterative outputs: https://gradio.app/key-features/#iterative-outputs

By the way, for general questions like this (that are not feature requests or bug reports), please ask in GitHub Discussions or our Discord. (I'll close this issue)

@arjunbansal
Copy link
Author

Thanks, I have some follow up questions which I will continue here.

@snarb
Copy link

snarb commented Aug 6, 2023

@arjunbansal did you find solution? yield-ing fil names with sleep hangs the UI during sleep @abidlabs maybe you can help

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