Thumbnail

Soundboard (EZB)

How to add the Soundboard (EZB) 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 Soundboard (EZB) 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 Soundboard (EZB) robot skill.

How to use the Soundboard (EZB) robot skill

This soundboard will play audio files through the EZ-B v4 speaker. You may load WAV or MP3 files into the library to have multiple audio files. Use the ControlCommand() scripts to trigger specific audio files.

Main Window




1. Stop Button
This button stops the audio coming from the Soundboard.

2. Clean Button
If audio files are deleted from the tracklist, they will leave a blank row. This button removes the blank rows from the tracklist.

3. Clipping Indicator
If the volume level bar is too high, this indicator will turn red and tell you that the audio is clipping. Clipping is a form of audio distortion where the top and bottom of the sound wave are "clipped" off, resulting in lower quality sound at a higher volume.

4. Volume Display
This displays the current volume percentage coming from the Soundboard. Depending on the volume slider's position, this value can be from 1(lowest) to 200% (highest).

5. Volume Slider
This slider adjusts the volume of the audio coming from the Soundboard.

6. Track Number Column
This column is where the track number is listed. These numbers are important when using controlCommand() scripts.

7. Tracklist Column
The track titles (+ file format) are listed in this column. Left-click on this area to add a track to the corresponding numbered row.

8. Track Management Buttons
These buttons play the audio, edit the track to include timed scripts, and delete the track.

Settings




1. Title Field
This field contains the title of the skill. You can change it if you'd like. *Note: Changing the title will also change the title in the controlCommand() associated with this skill.

2. Board Index Drop-down
Use this drop-down to select the board number that your EZ-B v4 represents. Double-check the number in the connection skill.

3. Get Music! Button
If you are connected to the internet, this button links you to the freemusicarchive.org, where you can download royalty-free music.

How to Use Soundboard (EZB)


1) Add the Soundboard (EZB) Skill to your ARC project (Project -> Add Skill -> Audio -> Soundboard (EZB)).

2) Click on the skill's Track List, then find and add a .mp3 or .wav file to the Soundboard.

3) Ensure you are connected to an EZ-B v4 with the ARC software, press the play button, and listen for audio to come out of the EZ-B v4 speaker.

Track Editor




The Track Editor is a unique feature of this skill. It allows you to add scripts to multiple timestamps in the track to execute robot movements (or other actions) that correspond with the audio track. Right-click on the audio waveform to have access to the following options:

  • Add Script Here: Adds a script to the selected timestamp.

  • Delete selected script: Deletes the script from the timestamp.

  • Play from here: Plays the audio track from the selected position.

  • Set selection start: Sets the audio track starting position for the selected timestamp.

  • Set Selection End: Sets the audio track finishing position for the selected timestamp.

  • Clear Range: Clears any "Start" and/or "End" positions added to the track.

  • Delete Selection: Deletes everything in between any set "Start and "End" positions.

  • Cut Selection: Cuts everything in between any set "Start and "End" positions.

  • Copy Selection: Copies everything in between any set "Start and "End" positions.

  • Paste Selection: Pastes everything in between any set "Start and "End" positions.

  • Delete Everything Before Here: Deletes the part of the waveform before the selected area.

  • Delete Everything After Here: Deletes the part of the waveform after the selected area.

  • Actions: Adds Auto Position actions instantly to the track into order to create quick dances and animations.


Control Commands

The soundboard accepts ControlCommand()'s and is published in the Cheat Sheet tab. Pressing the Cheat Sheet tab will display the ControlCommands() for all skills, including the Soundboard. You can control the behavior of the soundboard with control commands, such as:

  • controlCommand("Soundboard v4", "Track_xxx") - The "Track_xxx" can be substituted with the tracking number. For example, "Track_0" will play the first track of the soundboard, or track "Track_10" will play the tenth track, etc.

  • controlCommand("Soundboard v4", "Track_xxx", "ignoreScript") - This is similar to the previous command, with the "ignoreScript" option. The "ignoreScript" option will instruct the soundboard to play the audio but not to run any scripts associated with the audio. - The "Track_xxx" can be substituted with the track number. For example, "Track_0" will play the first track of the soundboard, or track "Track_10" will play the tenth track, etc.

  • controlCommand("Soundboard v4", "Track_Random") - Will play a random track on the soundboard.

  • controlCommand("Soundboard v4", "Stop") - Will stop playing the audio from the soundboard.


Requirements


An EZ-B v4 I/O Controller.

Resources


To create your sound recordings or edits to play in the Soundboard, you can use open-source audio software such as Audacity. Note that the sound files must be saved in .wav or .mp3 format. Here's a community tutorial on using Audacity for sound clips.

There's a also a community tutorial for using the Soundboard skill in general: here

Related Tutorials

Related Robots

Related Questions


ARC Pro

Upgrade to ARC Pro

Synthiam ARC Pro is a new tool that will help unleash your creativity with programming robots in just seconds!

PRO
Australia
#1  

Hi there,

I have been trying to get my JD robot to play sounds and songs in response to some voice commands. I used the block ControlCommand(soundboard_v4, "Track_1") in the speech recognition settings but when I use the command, the robot does not play the sounds. I am able to play the sounds from the soundboard only if I go in and edit the tracks. It does not let me play by pressing the play button on the soundboard window either.

What have I been doing wrong? There must be something I have missed.

PRO
USA
#2   — Edited

Good morn,

When you open ARC - turn off your anti -virus - I can't connect  to ARC with mine.

I just tested - I made a small mp3 file in audacity. called test5.mp3

Opened ARC,  clicked on audio, opened soundboard (PC) loaded the file, then I added "speech recognition, added in the java script with controlCommand("Soundboard", "Track_0");

Too come out of your "robot" - open ARC , you need to connect to robot b open soundboard EZB[/b]  add - speech recognition - add in the in the java script with - controlCommand("Soundboard v4", "Track_0");

I only had one track, so it is "Track_0"   -  I added a second track, so it is "Track_1" - and so on, and on...

In the computer world, we count 0 , 1, 2 ,3 etc...  not 1, 2, 3 etc...

It works well.

Hope this helps you

EzAng

PRO
Canada
#3   — Edited

Hello @Kat777

I noticed that there's an underscore in your code that shouldn't be there on "Soundboard v4".

Otherwise, the track should play in the Soundboard skill when you press play. I've never seen any issues with this unless a script is already using the Soundboard control or the volume is at 0.

PRO
Synthiam
#4   — Edited

Use the Cheat Sheet to display available control commands rather than guessing

reference this manual page: https://synthiam.com/Docs/Programming/control-command

PRO
USA
#5  

Always make sure you have the latest ARC

Version 2020.09.08.00 https://synthiam.com/Products/ARC

EzAng

PRO
Australia
#6   — Edited

Hi guys,

Here is an update. I have the latest version of ARC and my commands were written the same as in the cheat sheet. The underscore in my earlier comment was a typo. I managed to get my program working by switching off the speech recognition controls after activating the sequence using a voice command. If I leave the voice recognition on, my program terminates after taking in the background noise.

One thing I have noticed though, is some of the sounds I have included in my program do not play all the way through. I have included a short "BOING" sound that should play for 2 seconds but it gets cut 200 ms in. Is there a way of fixing this that you can recommend?

PRO
Synthiam
#7  

You can make them a bit longer with silence at the end. If they’re short the network buffering may cut it short. That’s pretty much at the mercy of the operating system and any networking hardware.

What do you mean by switching off the speech recognition controls? Do you mean that they’re removed/deleted from the project?

lastly, is the microphone a Bluetooth connection?

PRO
Australia
#8  

Hi DJ,

I'll try adding some silence on the end of the shorter tracks.

By switching off the speech recognition controls I meant I click the pause button on the speech recognition window in ARC so that the speech recognition is not picking up the background sounds and causing the program to cancel prematurely.

At the moment, I have been using my laptop's built-in microphone not a Bluetooth enabled device. Going to invest in a pair of noise-cancelling headphones eventually.

PRO
Synthiam
#9   — Edited

Are you able to reproduce that behavior of causing ARC to cancel prematurely? If so, I’d like a screenshot of the error if possible. Being at the mercy of OS hardware drivers makes diagnosing these things challenging sometimes.

A copy of the error message should get us aligned to find out what’s going on

Ps / answers to this question are specific to speech recognition so I have moved them to here: https://synthiam.com/Docs/Skills/Audio/Speech-Recognition?id=16118

PRO
Australia
#10   — Edited

Update: I added 1 second of silence to each end of my "boing" sound mp3 using Audacity and reuploaded the track to my soundboard. The sound should play for about 0.8 seconds in total (2.8 sec including the start and end silences). It runs how it should when I press play on the soundboard, but when I try to play the sound it as part of a bigger program, it plays the first 0.2 seconds and then moves onto the next part of the program.

I think if worst comes to the worst, I'll try to use a different track for my audio (a longer sound) but the weird thing is that this cutting off effect has happened with one of my longer tracks too.

#11   — Edited

It could be that your script is not pausing long enough for the sound to play before it moves to the next command. Try inserting a sleep command after the command to play the sound. In your case it should be a bit longer then 2.8 seconds. Three seconds should be good. The command should look like this: Sleep(3000)

If you have a sleep command then make sure it's 3 seconds or longer. This will pause the script until the sound is played before moving to the next command.

Let us know how it goes.

PRO
Australia
#12   — Edited

Hurrah! It worked! The key was making the sleep time longer than the duration of the sound played. Thank you so much, Dave  :)

#13  

Wow, I'm glad I was able to help and you found a solution. It's an old problem that a lot of people run into. Not really a problem but the way scripting works. Sometimes it's hard to understand how a script processes commands and what happens as it runs.

Often I'll want two actions to happen at the same time without a pause that normally would have the second command cancel out or stop the first action. Kinda like what happened to you with your sound file. To make this work I'll make a second script with the second command action. Then in the first script that holds the first command, after that command is executed, I'll state a (ControlCommand) to start that second script. Because of Windows ability to do Multithreading both commands will run from the two different scripts. That is as long as they are not using the same control like a sound board.

Have fun! Keep us posted on your progress. We love this stuff!

PRO
USA
#14   — Edited

I agree Dave, I have noticed the "sleep" has to be longer in many situations.

Kat777, check out the Speech Synthesis below , I explained how to add all the windows hidden voices for you.

EzAng

#15  

"Sleep" is a nice command that needs to be used often even though EZ Script is blazing fast. However you need to time the action you are waiting for yourself and figure out how long to make the sleep time. Usually not a big issue. However sometimes a better and more elegant command to use is "Wait". It's a little more involved to use then "Sleep" but more friendly to the command process and will make things more "automatic". Using the proper wait command you won't have to personally time your actions. This will keep something from starting before you want it to or cut some other action off. There are many versions of this command. To see all of them, in ARC, just do a "wait" search inside an EZ Script control under the "Script Help" tab.

PRO
USA
#16   — Edited

I see that in Ez script, not so much in the java or python  tabs

Thanks Dave for bringing up the "wait" function.

EzAng

#17  

I know nothing at this point about writing Java or python scripts.

PRO
USA
#18   — Edited

EZ script does it all anyway

I am happy there is EZ script, it reminds me where we all came from EZ -Robot -  it was easy :-)

EzAng

PRO
Synthiam
#19   — Edited

Arc doesn’t support Java. It does use JavaScript, however. It has a sleep command documented here: https://synthiam.com/Docs/javascript-api/javascript-overview

ezscript is actually very slow in comparison to JavaScript.

A more efficient option is to wait until the sound is completely played by monitoring the audio status variable in a loop. Add a sound (wait) in the Blockly UI and take a look at the JavaScript code.

here’s an example screenshot since I’m on my phone  User-inserted image

and I created the code example by adding a sound (wait) in blockly  User-inserted image

PRO
Indonesia
#20  

any chance to get source code to improve it for dynamic load files and play them?