Asked — Edited

How To Control Servo Moving When Play Music Or Audio?


Anyone can help to control the servo moving during play music? EZB4 have a talk servo function for text speech. But how about the music or audio?

I have tried the Sound board(PC) and Sound Servo(PC Speaker) to play the Music file, then the sound servo screen have a wave form, but the servo motor is not active(It already set min. & max number).

Pls. note the attached picture for ref. User-inserted image

Can anyone help to answer this question?

Thanks a lot! ;)


Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

United Kingdom

"Soundboard EZB" will do what you want.

But if you want to use the "Soundboard PC" and "Sound servo (PC speaker)", you can use a simple script. Add an "Ez-Script" control to your project, and, as an example, add the following example script...

#Assuming servo is connected to port D0

if($SoundValue >30)
elseif($SoundValue <29)

When the sound level goes above 30, the servo will move to position 180. When the sound level is below 29, the servo will move to position 1. Play with the "Update Speed" and "Scalar" settings, and the servo positions and length of sleep()'s in the script to suit your needs.


Hi Steve

Thanks your help again :D

Yes, I have copy & paste your script to EZ-script, but it pop up the message... Pls. see the picture file.

User-inserted image

And I have try to use the Sound board EZB & press the edit button, it is not show the wave form and pop up error message.. why? Pls. see the picture file. :(

User-inserted image

So depression.... :(


Hi, in line 3 of the code it should be ":loop" not "loop"

United Kingdom

Sorry, typing error. That should be...


Hi Steve & Proteusy,

Thanks a lots!

So, do you know what wrong with my sound board ezb problems?

My music is MP3 and then import and press the edit button, it can not shown the wave form and pop up the error message box!

Appreciated for help! ;)



Post your project with the soundboard EZB in it so one (or more) of us can test. I suspect we might have another locale/internationalization issue, but I am not sure. Would like to see what the error message is saying in English if the problem is duplicated on US systems. Can you tell us what that error message is saying?

Might be good to make a zip file and also include the MP3 you are using, so we can see if it is an issue with the music file itself.



Hi Alan,

Yes, I will do that before Sat! Thanks for your reply and help! ;)


Hi Alan,

Here is the link(ezb project & mp3 file ) for testing and screen clip picture for ref.

User-inserted image

Really thanks for everyone help ! ;)


Get this version of ARC for the fix:


Hi DJ,

Great! it work normally now!

Thanks a lot! ;)