ARC Pro

Upgrade to ARC Pro

Harnessing the power of ARC Pro, your robot can be more than just a simple automated machine.

PRO
Canada
#1  

To send text from a ChatGPT skill to Azure Text-to-Speech in ARC, you can follow these steps to integrate the two skills:

  1. Add the ChatGPT Skill:

    • First, ensure you have the ChatGPT skill added to your ARC project. This skill will handle generating the text you want to convert to speech.
  2. Add the Azure Text-to-Speech Skill:

    • Add the Azure Text-to-Speech skill to your ARC project. This skill will handle converting the text to speech using Azure's service.
  3. Create a Script to Connect the Skills:

    • You will need to create a script that takes the output from the ChatGPT skill and sends it to the Azure Text-to-Speech skill. Here's a basic example using JavaScript:
    // Assume the ChatGPT skill outputs text to a variable named $ChatGPTResponse
    var chatResponse = getVar("$ChatGPTResponse");
    
    // Use the  ControlCommand to send the text to Azure Text-to-Speech
    ControlCommand("Azure Text To Speech", "speak", chatResponse);
    
  4. Configure the Script to Run:

    • You can configure this script to run automatically whenever the ChatGPT skill generates a response. This can be done by setting up an event or trigger within the ChatGPT skill that executes the script.
  5. Test the Integration:

    • Test the setup by interacting with the ChatGPT skill and ensuring that the response is spoken using the Azure Text-to-Speech skill.

By following these steps, you can seamlessly integrate ChatGPT with Azure Text-to-Speech in ARC, allowing you to use different voices for the spoken output. If you have any further questions or need additional assistance, feel free to ask!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#2   — Edited

Expanding on what @Athena said, you'll use the ControlCommand to send the text from the ChatGPT response script to the Azure Text To speech.

  1. Click on the configuration button for the chat gpt robot skill

  2. Locate the Conversation Response Script button on the Response tab

  3. Click the response script button

  4. Currently, it should have a piece of code that uses the Audio.say() command to use the built-in speech synthesis. Delete that line of code

  5. Replace the line of code with the ControlCommand

ControlCommand("Azure Text To Speech", "speak", getVar("$OpenAIResponse"));

How did we get that line of code?

  1. When you RIGHT-CLICK and select the appropriate robot skill, you can see all available control commands in the editor. In this case, look at the Azure Text To Speech's control commands. This is what you'll see...

    User-inserted image

  2. Once you've selected that, you will only have the ControlCommand() without the values. You'll need to get the VARIABLE that contains the text. Look at the VARIABLES tab by clicking on it.

    User-inserted image

The appropriate text will be inserted when you click on a GLOBAL VARIABLE.

By combining those two steps (selecting the ControlCommand() and adding the variables), we created the command you see above.

PRO
Canada
#3  

To send text from the ChatGPT skill to Azure Text-to-Speech in ARC, follow these steps:

  1. Open the ChatGPT Skill Configuration:

    • Click on the configuration button for the ChatGPT robot skill in your ARC project.
  2. Access the Conversation Response Script:

    • Navigate to the Response tab.
    • Click on the Conversation Response Script button to edit the script that executes when the AI responds.
  3. Modify the Script:

    • You will likely see a line of code using Audio.say() to speak the response. Delete this line.
    • Replace it with the following line of code to send the text to Azure Text-to-Speech:
      ControlCommand("Azure Text To Speech", "speak", getVar("$OpenAIResponse"));
      

Explanation of the Code:

  • ControlCommand: This function sends a command to another robot skill within ARC.
  • "Azure Text To Speech": This is the name of the Azure Text-to-Speech robot skill. Ensure it matches the name of the skill in your project.
  • "speak": This is the command to instruct the Azure Text-to-Speech skill to speak the text.
  • getVar("$OpenAIResponse"): This retrieves the response text from the ChatGPT skill stored in the global variable $OpenAIResponse.

How to Construct the Command:

  1. Select the Control Command:

    • Right-click in the script editor and navigate to the Azure Text-to-Speech skill to view available control commands.
    • Select the speak command.
  2. Insert the Variable:

    • Click on the Variables tab in the script editor.
    • Select the $OpenAIResponse variable to insert it into the command.

By following these steps, you can have the ChatGPT response spoken using Azure Text-to-Speech, allowing you to utilize different voices provided by Azure. If you have any further questions or need additional assistance, feel free to ask!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.