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

Demo REPL below



		
loading editor...

Console

loading Svelte compiler...


		
loading editor...

Compiler options

result = svelte.compile(source, {
generate:
});


		
loading editor...