Asked

I have a question regarding the ability to play two sound files simultaneously using ARC's PC Soundboard feature. Unfortunately, I can't test this myself at the moment, as I am in the process of rebuilding my robot. However, having an answer would greatly assist in my planning.
Here’s an overview of my current setup:
- My robot includes a Single Board Computer (SBC) running Windows 11, on which ARC is installed.
- The SBC is connected to multiple EZ-B controllers that manage the lights and motors.
- The sound files for my robot are played through the computer's audio output jack, which is linked to ARC's PC Soundboard.
- The audio output from the computer is connected to a small amplifier with speakers to play the files.
My goal is as follows:
- I want to play two sound files from ARC at the same time.
- I have experience with triggering voice files using JavaScript in ARC's PC Soundboard.
- I aim to play a continuous background sound file independently of the intermittently script-triggered voice file.
- I need to manage the background sound file's volume using JavaScript scripts, as well as toggle it on and off.
- There are a couple of buttons on the robot that are monitored by the ADC and connected to an EZ-B, and I plan to use these to control the background sound file.
- It is important that all sound is output through the same audio jack, which is connected to a sound amp and speakers.
- For reference, the voice files are recorded on the right stereo channel, and the background sound file is on the left stereo channel.
Can ARC and Windows facilitate this setup and functionality using JavaScript scripts? Any advice or guidance would be greatly appreciated.
Related Hardware EZ-B v4
Related Control
Soundboard v2 (PC)
Below is some guidance and considerations regarding your proposed setup:
Splitting the SBC's Stereo Output to Separate Amplifiers
Safety and Feasibility
Common Practice:
Splitting a stereo signal so that one channel goes to one amp and the other channel goes to a different amp is a common technique in audio systems. Using a Y-adapter or a cable specifically designed to separate left and right channels is generally safe when done correctly.
Isolation:
Ensure that the cables and connectors used properly separate the two channels. In most cases, the stereo output from an SBC is designed to provide separate, isolated channels via a standard TRS connector (or RCA outputs with a proper splitter).
Audio Quality Concerns
As you already have the audio files recorded so that the voice files are on one channel and the background sound on the other, this method will maintain that separation. However, verify that there’s no unintended crosstalk between channels after splitting.
Although you’re using two different amplifiers, it’s important to balance the levels. You may need to adjust gain on one amplifier (or even reduce the background file’s level in Audacity) so that the overall output is as intended.
Power Supply / Converter Considerations
Using two different power supplies (one for the small 15W amp and another for the more powerful 100W amp) is acceptable, provided each converter is properly regulated and isolated.
A key consideration when using separate power sources is ensuring proper grounding. Inconsistent grounding between the two amplifiers might lead to hum or other noise issues. Verify that both converters and the amps have a common reference ground, if needed, to avoid any potential issues.
Additional Notes
Cable Quality:
Use high-quality adapters and cables to ensure that the signal remains clean and you avoid any potential voltage drops or interference.
Enclosure and Ventilation:
Since you mentioned that the 15W amp is small and will be placed within your robot, ensure there is proper ventilation. Overheating in confined spaces can affect performance and longevity.
Testing:
Before mounting everything permanently, it’s advisable to test the setup on a bench (or on your robot in a controlled environment). Verify that both channels are working independently, that the volumes can be reasonably balanced, and that there is no hum or interference from having different power supplies.
Summary
Yes, splitting the SBC’s left and right channels to run through separate amplifiers is a safe and viable method-provided you use appropriate cables, watch for proper grounding, and balance the gains between the two amplifiers. Using separate power converters is fine as long as you’re mindful of isolating and matching the ground references to minimize potential interference.
If you have any further questions about your setup or need assistance with testing configurations in ARC scripts or hardware considerations, feel free to ask. Good luck with your project, and I look forward to seeing your video once it’s ready!
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.
@Athena ,
Your Method 1 works nicely. By placing the ControlCommand to restart the sound file in the "Sound Complete Script" section of the PC Soundboard keeps the sound file looping.
However there is a noticeable gap of silence between plays. It ruins the effect. I need it to sound like a unbroken sound of relays opening and closing. I tried to play the same file from two different PC soundboards but starting a few seconds apart then looping with the Sound Complete Script as you suggested. That works to close the gap but it's a bit much. Instead of hearing a few relays opening and closing and computers whirling the two files playing at the same time make it sound like a room full of them. LOL.
So, along that same line of thinking I've been able to make something else work that is acceptable. This background sound file is 31 seconds long. If I start another instance of this same file (from a different ARC PC Soundboard) at 30 seconds into the first file playing both will play for a fraction of a second and the silence gap is closed. The second file will play over the first file for a fraction of a second then the first file ends leaving the second file to play. Then I'll do the same with the first file, again starting it just as the second file ends. In short I'll manually loop the two (same) files from two different PC soundboards.
Can you help me with writing a JavaScript script that will start a sound file from one PC Soundboard, wait 30 seconds and then start the same file that's loaded into another PC Soundboard? This would have to keep looping like described above. I understand I would have to start and stop this script with other commands.
If there are any other methods of closing the silence gap between loops I'm open to suggestions. Just to be clear, there is no silence at the start or finish of this background sound file.
Thanks.
Below is an example JavaScript script you can run in ARC to alternate playing the same track on two separate PC Soundboards so that one starts 30 seconds after the other. This creates an overlapping loop intended to hide the silence between loops.
Make sure you replace "Soundboard_A" and "Soundboard_B" with the actual names of your two PC Soundboard skills and "Track_Background" with the ControlCommand for the track loaded on each soundboard, if different.
How This Works
$bgLoopActive
, to true. This flag controls whether the loop continues.playAlternateBackground()
, it enters a loop that will continuously run as long as$bgLoopActive
remains true.sleep()
(measured in milliseconds).$bgLoopActive
to false and issuing a stop command to both soundboards.Additional Considerations
Timing Sensitivity:
If you notice a slight gap or overlap that isn’t to your liking, adjust the sleep durations (for example, try 29500 ms or 30500 ms) to fine-tune the trigger.
Seamless Looping:
This method plays two instances alternately, so if the gap between loops (or the overlapping time) still isn’t exactly right, slight adjustments may be necessary depending on the performance of your SBC and ARC’s response times.
Stopping the Loop:
Include a separate mechanism (perhaps a physical button or a voice command) that sets the global
$bgLoopActive
to false and stops any currently playing sound files.Give this script a try in your ARC project and adjust the timing if needed. Do let me know if you have any questions or further adjustments to discuss!
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.
To have an audio file repeat forever, you can use the latest SoundBoard v2 (PC) robot skill. It allows passing a parameter on the ControlCommand to instruct the track to be repeated forever until the Stop is received.
Here is the link: https://synthiam.com/Support/Skills/Audio/Soundboard-v2-PC?id=21165
That's correct! The latest SoundBoard v2 (PC) robot skill now allows you to specify an extra parameter on the ControlCommand that tells the track to loop indefinitely until you issue a Stop command.
For example, if your track is named "background.mp3", you can start it in a forever loop with a command like this:
In this command, the fourth parameter (set to true) tells the skill to repeat the track continuously. When you want to stop the playback later, you can issue:
This approach offers a much cleaner solution than manually juggling two soundboards, and it eliminates the gap between plays. It’s an ideal method to achieve an uninterrupted looping sound, such as the clicking relays or mechanical noises you described.
For more details, check out the SoundBoard v2 (PC) robot skill documentation on the Synthiam website here:
https://synthiam.com/Support/Skills/Audio/Soundboard-v2-PC?id=21165
Let me know if you have any further questions or need additional help!
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.
@Synthiam Support and @Athena,
Wow, thanks for pointing this out and doing the skill's updates. This really helps. It has all the stuff I've been asking about.
I was unaware there was a V2 of the PC soundboard. Was this V2 PC Soundboard skill just recently released?
I'll have to install it and give it a try. Hopefully in the next day or two. As I mentioned above, I'm doing some upgrades and right now I have some of the robot's electrical and sound system wiring apart. I'll report back.
Thanks again! I'm excited.
That's great to hear, Dave! Yes, the SoundBoard v2(PC) skill is relatively new and includes the looping functionality that you were looking for-so it should really help simplify your setup.
Once you install it, you'll be able to use the extra parameter to have your track loop continuously until you send a Stop command:
controlCommand(Soundboard v2(PC), Play, background.mp3, true)
When you want to stop, simply call:
controlCommand(Soundboard v2(PC), Stop)
This should eliminate any gaps between loops and give you the seamless playback you need.
Let me know how it works out for you, or if you run into any issues during your upgrades. I'm excited to hear about your progress-feel free to update me once you've had a chance to test everything out!
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.
The v2 soundboard was created 3 or 4 years ago. It’s useful because it has functionality to add scripts to the audio playback similar to the ezb. It's funny because the latest release is v6 of the soundboard v2 haha. So many v's