|
<< 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 |
MiniRobotLanguage (MRL)
AIU.GetTtsVoice
Retrieves the current Text-to-Speech voice name.
Intention
The AIU.GetTtsVoice command (aliased as AIU.gtsv) allows you to check which voice is currently configured for use with the Text-to-Speech API. This is useful for confirming the current setting before making a call to AIU.TextToSpeech or for displaying the current state in a user interface.
Illustration
┌──────────────────────────┐
│ AIU Settings │
├──────────────────────────┤
│ Voice: "onyx" │
├─────────────┬────────────┤
│ Command │ Result │
├─────────────┼────────────┤
│ GetTtsVoice │ "onyx" │
└─────────────┴────────────┘
Querying the currently configured TTS voice.
Syntax
AIU.GetTtsVoice|$$RET
Parameter Explanation
P1 - $$RET - (Variable, String, Required)
The variable where the current TTS voice name will be stored (e.g., "alloy", "onyx").
Examples
'***********************************
' AIU.GetTtsVoice - Sample 1: Check the current voice
'***********************************
' First, set a specific voice
AIU.SetTtsVoice|shimmer
' Now, retrieve it to verify
AIU.GetTtsVoice|$$VOI
MBX.Current TTS Voice:|$$VOI
END.
Remarks
- The alias AIU.gtsv can be used for convenience.
- The returned value will be one of the six supported OpenAI voices: "alloy", "echo", "fable", "onyx", "nova", or "shimmer".
See also: