Save speech to file

From UBot Studio
Revision as of 17:24, 12 July 2023 by LillyT (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

save speech to file is a command that generates speech from the given text and a specified voice, then saves it to a designated output file.

The Speech Synthesis commands use the Eleven Labs API to generate highly realistic sounding speech. Since there is some lag time in creating the audio, UBot Studio saves the all the audio generated to the hard drive. This way, when you play the speech audio, it can be played immediately instead of needing to wait for it to generate.

In the case of save speech to file, lag time may be less of an issue, but it's still important to note what is happening behind the scenes.

Parameters

Text: The text that you wish to convert into speech.

Voice: The voice that you want to use for the speech synthesis. The values in the dropdown are provided by default by Eleven Labs. If you have created or imported other voices, you can manually enter the name of any voice in your account.

Output File: The file where you want to save the synthesized speech.

Refresh: If set to True, this command will regenerate the audio even if it was previously generated. If set to false, the command will only generate new audio if the audio for the text was not previously generated. Otherwise it will save the already-generated audio to the specified location. It defaults to False.

Example

connect to speech synthesis("your API key")
save speech to file("Hello, UBot Studio!", "Rachel", "C:\Documents\Rachel_says_hello.mp3", True)

Please replace "your API key" with your actual API key.

The script provided converts "Hello, UBot Studio!" into speech using the "Rachel" voice. The speech is then saved as “C:\Documents\Rachel_says_hello.mp3". The 'refresh' parameter is set to true, meaning that if the speech was previously generated, it will be regenerated.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox