Text to Speech with Hugging Face
This is a demo of text to speech using the Hugging Face Inference A.P.I. with Svelte. This is content editable by the way. Try changing the text and generating new audio.
The Accelerated Inference API can be used for more than just text. It can also be used for Audio and Images. For media, the API returns an Array Buffer containing the audio data that can be turned into a Blob, and then an Object URL that you can use as a src in a Audio element. Svelte makes life easier again with the await block and bindings! See the code below.
Model Spotlight:
This Model is from ESPnet on Hugging Face
More Reading
- API Infrence Docs
- Hugging Face Models
- Spaces
- Hugging Face on Sage Maker
- Svelte Contenteditable Bindings
- Array Buffer
- Blob
- Object URL