AIU. - Artificial Intelligence Utility

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIU. - OpenAI API > ! Speech and Voice Configuration >

AIU. - Artificial Intelligence Utility

AIU.SetTtsModel

Previous Top Next


MiniRobotLanguage (MRL)

 

AIU.SetTtsModel
Sets the model to be used for Text-to-Speech.

 

Intention

 

The AIU.SetTtsModel command (aliased as AIU.Stsm) selects the underlying AI model that will be used to generate audio with the AIU.TextToSpeech command. You can choose between a standard, fast model and a high-definition model for the highest quality audio.

 

It’s like choosing the engine for your robot’s voice—AIU.SetTtsModel lets you decide between speed and superior audio quality for the speech you generate.

 

Illustration

 

┌─ AI Voice Model Selection ─┐

│                            │

│ ( ) tts-1 (Standard)       │

│ (◉) tts-1-hd (HD Audio)    │

│                            │

└────────────────────────────┘

Selecting the desired audio quality for speech synthesis.

 

Syntax

 

AIU.SetTtsModel|$$MDL

 

Parameter Explanation

 

P1 - $$MDL - (Variable, String, Required)

The name of the Text-to-Speech model to use. The value is case-insensitive. Valid options are:
"tts-1" - (Default) Optimized for real-time use cases.
"tts-1-hd" - Optimized for quality.

 

Examples

 

'***********************************

' AIU.SetTtsModel - Sample 1: Select High Definition model

'***********************************

VAR.$$KEY=sk-YourSecretKeyHere

AIU.SetKey|$$KEY

 

' Set the model to high definition for the best quality

AIU.SetTtsModel|tts-1-hd

 

VAR.$$TXT=Hello from the high definition model.

VAR.$$PTH=?path\hd_audio.mp3

AIU.TextToSpeech|$$TXT|$$PTH

 

AIU.GetLastError|$$ERR

JNZ.$$ERR|Lab_failed

 

MBX.Success:|Audio file created at $$PTH

END.

 

 

Remarks

 

- The alias AIU.Stsm can be used for convenience.

- The default model is "tts-1" if this command is never called.

- If an invalid model name is provided, the setting will revert to the default ("tts-1").

- The chosen model setting persists for the duration of the script session or until it is changed again.

 

See also:

 

AIU.TextToSpeech

AIU.GetTtsModel

AIU.SetTtsVoice