Thumbnail

Talk Servo V2

by Synthiam

Bind a servo to spoken audio to move a mouth similating speaking

Requires ARC v4 (Updated 11/29/2023)

How to add the Talk Servo V2 robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Audio category tab.
  5. Press the Talk Servo V2 icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the Talk Servo V2 robot skill.

How to use the Talk Servo V2 robot skill

This skill will bind to the Text-to-speech engine and move servos to simulate jaw movement when speaking. This skill will move the specified servos to simulate a mouth movement whenever a text-to-speech script command is executed (i.e., Say, SayEZB, SayWait, SayEZBWait). If your robot has servos connected to simulate a mouth, this skill will move those servos while speaking.

If the robot skill that is speaking is not using the built-in Say() commands (such as the Azure Text To Speech), you can use the ControlCommand() "Speak," which simulates the mouth servos with the first parameter.

This skill has parameters to configure for the voice and voice settings selection. Every voice and different voice settings (i.e., speaking speed) will require custom settings. The settings are delayed for each type of audio. For example, there are delay specifications for Constants and Vowels. The mouth is closed when a Constant is detected and opened when a vowel is detected. The mouth is again closed at the end of a word or sentence. The delays for each setting can be specified to tune your effect.

Main Window

User-inserted image

1. Text Display Displays the text sent by a script to activate the servo movement.

2. Pause Checkbox When checked, the talk servo skill will be paused and won't execute servo commands until unchecked.

3. Stop Button This button will stop the servo movement at any time.

4. Script A script must be used to activate the Talk servo skill. Use commands like Say, SayEZB, SayWait, or SayEZBWait to trigger the servo movement.

Settings

User-inserted image

1. Title Field This field contains the title of the Talk servo skill. You can change it if you'd like.

2. servo Settings This section lets you set up servo movement parameters such as servo port, board index, servo configuration, max/min degree limitations, multiple servo control, and inverted direction.

3. Constant Delay Drop-down The talk servo will go to the minimum servo value for each consonant in the text being executed by this skill. The value in this drop-down determines how long the servo will stay in that position. The range is 10-1995 milliseconds. The default is 90 ms.

4. Vowel Delay Drop-down For each vowel in the text this skill executes, the talk servo will go to the maximum servo value. The value in this drop-down determines how long the servo will stay in that position. The range is 10-1995 milliseconds. The default is 40 ms.

5. Period Delay Drop-down The talk servo will go to the minimum servo value for each period or coma in the text being executed by this skill. The value in this drop-down determines how long the servo will stay in that position. The range is 10-1995 milliseconds. The default is 300 ms.

6. Start Delay Drop-down The text-to-speech engine and audio buffer are slightly delayed before the audio begins to play. Use this drop-down to adjust the delay before the Talk servo movement begins. Use this delay to sync up the servo movements with the audio. The range is 10-1995 milliseconds. The default is 460 ms.

Control Commands

Several ControlCommand() can be used to interact with the talk servo v2 robot skill.

PauseOn Check the PAUSE checkbox so the talk servo skill no longer activates when speech is set. Example: ControlCommand("Talk servo v2", "PauseOn");

PauseOff Uncheck the PAUSE checkbox so the talk servo skill will begin speaking. Example: ControlCommand("Talk servo v2", "PauseOff");

PauseToggle Toggle the PAUSE checkbox status. Example: ControlCommand("Talk servo v2", "PauseToggle");

Speak Speak the text that is specified as the first parameter. This can be used to instruct the skill to begin animating the text. Example: ControlCommand("Talk servo v2", "Speak", "Some text to be speaking");

Stop Stop speaking the current animation. Example: ControlCommand("Talk servo v2", "Stop");

How to use Talk Servo

This short tutorial will demonstrate how the Talk servo works when the robot is instructed to speak. Any control that uses the text-to-speech engine will cause the Talk servo robot skill to move the servo. This tutorial will use Blockly to have the robot speak and move the servo.

  1. Attach a servo to the EZB controller on port D0

  2. Add this Talk servo skill to your ARC project (Project -> Add Skill -> Audio -> Talk Servo).

    User-inserted image

  3. Add a Script skill to your ARC project (Project -> Add Skill -> Scripting -> Script).

    User-inserted image

  4. Press the config button on the Talk servo robot skill

    User-inserted image

  5. The Talk servo config menu will display. Select the port for the servo. Also, specify the minimum and maximum positions for that servo. Press SAVE to save these configuration settings.

    User-inserted image

  6. Press the Config button on the Script robot skill.

    User-inserted image

  7. Switch to the Blockly tab

    User-inserted image

  8. Expand the AUDIO section. Select one of the two blocks for having the robot speak. The Say EZB block will speak out of the EZB speaker (if supported). The Say PC block will speak out of the PC speaker.

    User-inserted image

  9. Expand the TEXT section. Drag the text string and fit it into the Say block.

    User-inserted image

    User-inserted image

  10. Edit the string to some text that you wish the robot to speak.

    User-inserted image

  11. Save the script

    User-inserted image

  12. Ensure you are connected to an EZB (required to move the servo). Now, press the START button on the script. Watch the servo move as the robot speaks your phrase.

    User-inserted image

Now that you have seen how the Talk servo works, you can have any robot skill that speaks to move the servo. Look at the chatbot robot skills, such as AIMLBot, BotLibre, or PandoraBot, in the Artificial Intelligence section of the robot skill store.

Requirements

A servo motor and an EZB I/O controller.


ARC Pro

Upgrade to ARC Pro

Unleash your creativity with the power of easy robot programming using Synthiam ARC Pro

PRO
USA
#1  

Is this free like it use to be?

#3   — Edited

I just noticed this said V2. Is this a new issuance or is it the same rev from the last 12 months or so? The one I was using worked very well.

Thanks, Perry

PRO
Synthiam
#4  

I don’t think there was an update to the skill. Only the description was updated in this skill. I think a tutorial was added to it

PRO
United Kingdom
#5   — Edited

Hi All, 1st time post.   Been using ARC a while love it.   I was using the above example on Vern my as yet Half InMoov.   When I used.

SayPC (Hello World)

The talk servo worked as expected, with the voice coming from PC speaker.

When I used

SayEZB (Hello World}

The voice came from speaker in robot attached to EZB controller as expected but no movement from Talk Servo.

I tried with an IoTiny and got the same result.  Also tried with another PC and got the same result.

Hope this is clear.  I have the most recent update of ARC.  I’m a bit stumped,  It was working all as expected correctly on previous update.

Many thanks

PRO
USA
#6   — Edited

User-inserted image

I use: min = 1 max - 180

PRO
United Kingdom
#7  

Thank you,    I'll give it a go and report back..

#8  

We can confirm the talk servo v2 isn't working with EZB - I've filed a bug report, and it'll be addressed asap. Thank you for the kind words about ARC; I'll share them with the team:D. Apologies for the talk servo bug - we'll resolve it shortly.

PRO
United Kingdom
#10  

;) amazing, thanks DJ and Synthiam support.  All working correctly,  Vern can speak again

PRO
United Kingdom
#12  

Hey EzAng,  video really cool, nice one,  did you use Arduino and uart to sync the LEDs ?

PRO
USA
#13   — Edited

Sorry it took so long to get back with you, I have been gone for a few days.

Thanks for your comments...

No, this time I used the Ezb4 controller, connected the LEDs to ground and signal to work

I used: the Talk servo V2, fine tuning all the adjustments audio toolbox for different voices and script Script for the audio 5 LEDs small servo for mouth, wires, tape, EZB4 controller, ARC, servo city parts for stand, mask, cut for the mouth

User-inserted image

You can use the Arduino if you prefer, it works the same way with DJ's Arduino software. On my Arduino I have a shield, easy to plug servos, LEDs or whatever into it. Also, I use an external power source for bigger servos.

COM 3. baud 57600

User-inserted image

#14   — Edited

Hi question for the group.  Is there anyway to get the value of the servo like in the Sound servo skill and use it in a script on this skill?

#16  

No problem Dave.  Being new to ARC I am just wondering if there is a way to find out what values in a skill can be used in a script and if there is a way to figure what those variables are.

Like in this skill is there a way to know what position value the skill is sending to the servo.

#17  

there is a small problem Talk servo Skill. If you write in Cyrillic then we have sound but the servo does not work. If we write in Latin then everything is ok. Problem to use by multinational users.

#18  

So DJ does the talk servo skill support Cyrillic like FANT0MAS is asking?  I would think if the sound comes out the servo should also work or am I missing something?

PRO
Synthiam
#19  

Quoted from the skill description above

Quote:

This skill will bind to the Text-to-speech engine and move servos to simulate jaw movement when speaking. Whenever a text-to-speech script command is executed (i.e. Say, SayEZB, SayWait, SayEZBWait), this skill will move the specified servos to simulate a mouth movement. If your robot has servos connected to simulate a mouth, this skill will move those servos while speaking.

so I don’t know what the thing is you’re referring to - but if it uses the text to speech engine in windows and the say, etc commands then yes. If not, then no.

#20   — Edited

Try testing the word "Hello" in different European languages:

(Privet)

  :

Oh. Even the chat does not display words distinct from English. send as picture:

User-inserted image

PRO
Synthiam
#21  

In guessing the reason those languages don’t work is the syllables aren’t detected. The syllables I think use the vowels against consonants and those languages aren’t being supported by the syllable library.

PRO
Synthiam
#22  

I searched the internet and could not find a library that uses multiple languages with different syllable character sets. Let me know if you find one, and I can look into it.

PRO
Canada
#23  

Hi @Athena depending on the speech settings with speech rate of slow medium fast etc do you have a formula for calculating each speech rate setting for Talk servo. Example if servo is set min 60 max 120 and you select medium what is constant delay, vowel delay and period delay. Is there a way to calculate this for each speech rate or is this trial and error?

PRO
Canada
#24  

The Talk servo skill in ARC does not have a formula for automatically calculating the delays for different speech rates. The settings for constant delay, vowel delay, and period delay are dependent on the specific voice and speech rate you are using, and they generally require some trial and error to fine-tune for natural-looking mouth movements.

Here are some steps you can follow to adjust the Talk servo settings for different speech rates:

  1. Start with the default values provided by the Talk servo skill.
  2. Test the speech with the default settings and observe the mouth movements.
  3. Adjust the constant delay, vowel delay, and period delay settings incrementally to better match the timing of the speech.
  4. Test the speech again after each adjustment to see if the mouth movements look more natural.
  5. Repeat the process until you are satisfied with the synchronization between the speech and the servo movements.

Remember that the delays are measured in milliseconds, and you may need to adjust them based on the specific characteristics of the voice you are using. For example, a faster speech rate may require shorter delays, while a slower speech rate may require longer delays.

If you need further guidance, you can refer to the support section on the Synthiam website for articles related to the Talk servo skill: https://synthiam.com/Support/Skills/Audio/Talk-Servo-V4?id=16123

Keep in mind that fine-tuning these settings is often a matter of personal preference and the specific requirements of your robot's design.


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.
PRO
Canada
#25  

@athena audio.stop worked is there a ControlCommand for talk servo to stop as well.  All I see is talk servo pauseon but then I have to do a pauseoff at the beginning of every script.

#26   — Edited

v4 updated with a new ControlCommand() to stop the current speaking animation.

*Note:

  • moved Nink's conversation from Chat GPT into this robot skill thread.
  • removed Athena's guess attempt at how to stop the talk servo.
PRO
Canada
#27  

Nice thanks. That was quick.

PRO
Synthiam
#28  

While I sit talking to GPT, it rambles. I did remember there's a stop speaking button in the Options menu tab of ARC

User-inserted image