Start playing speech

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''start playing speech''' is a command that starts playing the speech generated for the given text and voice. The Refresh parameter can force the speech to be generated ane...")
 
 
Line 1: Line 1:
'''start playing speech''' is a command that starts playing the speech generated for the given text and voice.  
+
'''start playing speech''' is a command that starts playing the speech for the given text and voice.  
  
The Refresh parameter can force the speech to be generated anew and played back.
+
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 '''start playing speech''' command will automatically generate the speech if it is not already generated. If the speech is generated, it will immediately play the generated speech audio.
 +
 
 +
Note that the script will continue as the audio is playing. If you need the script to pause while the audio plays, use the '''wait for speech''' command.
  
 
== Parameters ==
 
== Parameters ==
Line 7: Line 11:
 
'''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 wish to use for the speech synthesis. Available options are listed in a dropdown menu: Rachel, Domi, Bella, Antoni, Elli, Josh, Arnold, Adam, and Sam.
+
'''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 speech to be regenerated if set to true. This means that if the speech was previously generated, it will be regenerated before playback. The default setting is 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 19:
 
<pre>
 
<pre>
 
connect to speech synthesis("your API key")
 
connect to speech synthesis("your API key")
start playing 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.
+
Please replace "your API key" with your actual API key for Eleven Labs.
 
+
The script provided converts "Hello, UBot Studio!" into speech using the "Rachel" voice. The speech is then played back. The 'refresh' parameter is set to 'true', meaning that if the speech was previously generated, it will be regenerated for playback.
+
  
Always handle your API Key carefully due to its sensitivity. An incorrect or exposed key could result in errors or a breach of security. Please make sure the selected voice ("Rachel", "Domi", "Bella", "Antoni", "Elli", "Josh", "Arnold", "Adam", "Sam") is available in your speech synthesis API.
+
In the script provided, "Hello, UBot Studio!" is converted into speech using the "Rachel" voice. The speech is played, and then the script waits for the audio to finish playing.

Latest revision as of 17:31, 12 July 2023

start playing speech is a command that starts playing the speech for the given text and 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 start playing speech command will automatically generate the speech if it is not already generated. If the speech is generated, it will immediately play the generated speech audio.

Note that the script will continue as the audio is playing. If you need the script to pause while the audio plays, use the wait for speech command.

[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")
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 speech is played, and then the script waits for the audio to finish playing.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox