Save speech to file

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''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 Refresh parameter forc...")
 
 
Line 1: Line 1:
 
'''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.  
 
'''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 Refresh parameter forces the speech to be regenerated and saved in the specified file, 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.
 +
 
 +
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 ==
 
== Parameters ==
Line 7: Line 9:
 
'''Text:''' The text that you wish to convert into speech.
 
'''Text:''' The text that you wish 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.
  
 
'''Output File:''' The file where you want to save the synthesized speech.  
 
'''Output File:''' The file where you want to save the synthesized speech.  
  
'''Refresh:''' This parameter forces the regeneration of the speech file 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. Otherwise it will save the already-generated audio to the specified location. It defaults to False.
  
 
== Example ==
 
== Example ==
Line 17: Line 19:
 
<pre>
 
<pre>
 
connect to speech synthesis("your API key")
 
connect to speech synthesis("your API key")
save speech to file("Hello, UBot Studio!", "Alexa", "mySpeech.mp3", true)
+
save speech to file("Hello, UBot Studio!", "Rachel", "C:\Documents\Rachel_says_hello.mp3", True)
 
</pre>
 
</pre>
  
 
Please replace "your API key" with your actual API key.
 
Please replace "your API key" with your actual API key.
  
The script provided converts "Hello, UBot Studio!" into speech using the "Alexa" voice. The speech is then saved as “mySpeech.mp3". The 'refresh' parameter is set to true, meaning that if the file was previously generated, it will be regenerated.
+
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.
 
+
Always handle your API Key carefully due to its sensitivity. An incorrect or exposed key could result in errors or a breach of security. Also, ensure the specified voice is supported by the speech synthesis service connected.
+

Latest revision as of 17:24, 12 July 2023

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.

[edit] 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.

[edit] 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