Generate speech

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''generate speech''' is a command that generates speech from the given text, using the specified voice. The Refresh parameter forces the speech to be regenerated, providing...")
 
 
Line 1: Line 1:
 
'''generate speech''' is a command that generates speech from the given text, using the specified voice.  
 
'''generate speech''' is a command that generates speech from the given text, using the specified voice.  
  
The Refresh parameter forces the speech to be regenerated, providing you with an updated version of the synthesized speech.
+
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.
 +
 
 +
the '''generate speech''' command allows you to generate the speech audio and save it to the hard drive, so that it will play in real time if you later use '''start playing speech'''. This is not required, but can be convenient for applications that require real time playback.
  
 
== Parameters ==
 
== Parameters ==
Line 7: Line 9:
 
'''Text:''' The text that you want to convert into speech.
 
'''Text:''' The text that you want to convert into speech.
  
'''Voice:''' The voice that you want to use for the speech synthesis.  
+
'''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.
  
'''Refresh:''' This parameter forces the regeneration of the speech if set to true. It defaults to false.
+
'''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. It defaults to False.
  
 
== Example ==
 
== Example ==
Line 15: Line 17:
 
<pre>
 
<pre>
 
connect to speech synthesis("your API key")
 
connect to speech synthesis("your API key")
generate speech("Hello, UBot Studio!", "Alexa", true)
+
generate speech("Hello, UBot Studio!", "Rachel", True)
 +
start playing speech("Hello, UBot Studio!", "Rachel", False)
 +
wait for speech
 
</pre>
 
</pre>
  
Please replace "your API key" with your actual API key for the speech synthesis service.
+
Please replace "your API key" with your actual API key for Eleven Labs.
  
In the script provided, "Hello, UBot Studio!" is converted into speech using the "Alexa" voice. The 'refresh' parameter is set to true, meaning that if the speech was previously generated, it will be regenerated.
+
In the script provided, "Hello, UBot Studio!" is converted into speech using the "Rachel" voice. The 'refresh' parameter is set to true, meaning that if the speech was previously generated, it will be regenerated.
  
Always double-check your API key, and handle it carefully due to its sensitivity. An incorrect or exposed key could result in errors or a breach of security. Also, ensure the voice you selected is supported by the speech synthesis service connected.
+
The script then plays the generated audio, and waits for it to finish.

Latest revision as of 17:15, 12 July 2023

generate speech is a command that generates speech from the given text, using the specified voice.

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.

the generate speech command allows you to generate the speech audio and save it to the hard drive, so that it will play in real time if you later use start playing speech. This is not required, but can be convenient for applications that require real time playback.

[edit] Parameters

Text: The text that you want 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.

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. It defaults to False.

[edit] Example

connect to speech synthesis("your API key")
generate speech("Hello, UBot Studio!", "Rachel", True)
start playing speech("Hello, UBot Studio!", "Rachel", False)
wait for speech

Please replace "your API key" with your actual API key for Eleven Labs.

In the script provided, "Hello, UBot Studio!" is converted into speech using the "Rachel" voice. The 'refresh' parameter is set to true, meaning that if the speech was previously generated, it will be regenerated.

The script then plays the generated audio, and waits for it to finish.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox