| hf_text_to_speech | R Documentation |
Generate speech audio from text and write it to disk. The public 'hf-inference' provider did not expose a broadly available TTS model during verification; use this with a compatible model/provider or dedicated Inference Endpoint.
hf_text_to_speech(
text,
output = NULL,
model = hf_default_model("text_to_speech"),
token = NULL,
endpoint_url = NULL,
overwrite = FALSE,
...
)
text |
Character vector of text to synthesize. |
output |
Character path(s) or NULL. When NULL, files are written to temporary paths with an extension inferred from the response content type. |
model |
Character string. Model ID from Hugging Face Hub. Default: "hexgrad/Kokoro-82M". |
token |
Character string or NULL. API token for authentication. |
endpoint_url |
Character string or NULL. A custom Inference Endpoint URL. |
overwrite |
Logical. If TRUE, overwrite existing output files. |
... |
Additional generation parameters passed to the model. |
A tibble with columns: text, path, content_type, audio.
https://huggingface.co/tasks/text-to-speech
## Not run:
hf_text_to_speech("Hello from R.")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.