Recorder icon Recorder — Record and replay EZB communications (servo & digital commands) with forward/reverse playback, save recordings and trigger them from scripts Try it →
Asked
Resolved Resolved by Athena!
1 Participant
Audio.Playaudiofile() Vs Soundboard Skills

Audio.Playaudiofile() Vs Soundboard Skills

Could you explain the advantages and disadvantages of using the ARC JavaScript command Audio.playAudioFile() inside an ARC script?

For context: I'm running ARC on the robot's onboard PC and all of my sound files are stored locally on that same computer (i.e., PC-connected audio, not on an EZB). I'm using ARC scripting (JavaScript) to trigger audio playback from within an ARC project. Would using Audio.playAudioFile() remove the need to use the Soundboard/PC soundboard Robot Skill(s) in ARC if all sound files are local to the ARC PC?

A couple of my personal thoughts to clarify my question:

  • I suspect it might be harder to manually write scripts and keep audio files organized without ARC’s Soundboard Robot Skill(s) managing them.
  • I also suspect that if I have many sound files, calling them directly with Audio.playAudioFile() might keep my ARC project smaller (fewer robot skill configurations).

I'm looking for a comparison specifically in the context of ARC Robot Skills and JavaScript scripting (no need to discuss EZB hardware here, since audio is local to the ARC PC).



Related Hardware (view all EZB hardware)
EZ-B V4 by EZ-Robot
EZ-B v4 with Synthiam ARCx controls servos, sensors, camera and audio over Wi-Fi or USB serial, no firmware needed.
Wi-Fi / USB
Servos 24
Camera
Audio
UART 3
I2C
ADC 8
Digital 24

Related Robot Skills (view all robot skills)
Soundboard (PC) by Synthiam
Play and manage MP3/WAV sound effects from a PC soundboard, load tracks, trigger or script playback (one file at a time), export and automate.
Speech Synthesis by Synthiam
Speak user-defined text via PC audio or EZ-B v4 speaker; configurable voices, effects and speed; uses Windows TTS; programmatically callable.

ARC Pro

Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

Author Avatar
PRO
Canada
Twitter YouTube GitHub
#1  

Yes - if the audio files are local on the ARC PC, then Audio.playAudioFile() can absolutely replace the need for the Soundboard (PC) skill in many projects.

That said, there’s a better default approach in ARC depending on what you need:

  • Use Audio.playAudioFile() when you want:

    • simple script-triggered playback
    • fewer robot skills in the project
    • direct control from JavaScript
    • one-off sounds, cues, or lightweight automation
  • Use the Soundboard (PC) skill when you want:

    • a visual list of sounds that’s easy to manage
    • non-programmers to trigger audio manually
    • track naming and organization inside ARC
    • built-in ControlCommand() support for play/stop/count

Comparison

Audio.playAudioFile()

Advantages

  • No Soundboard skill required
  • Less project clutter
  • Easy to call directly from JavaScript
  • Good for automation and logic-driven projects
  • Works well when audio filenames are already known

Disadvantages

  • You must manage file paths yourself
  • No built-in track list UI
  • Harder to browse and maintain lots of sounds
  • Less friendly for manual operator use
  • No built-in "track management" inside ARC

Example:

Audio.playAudioFile("C:\\MyRobotSounds\\startup.wav");
sleep(1000);
Audio.playAudioFile("C:\\MyRobotSounds\\beep.wav");

Soundboard (PC) skill

Advantages

  • Built-in sound library UI
  • Easier to organize many sounds
  • Easier to rename, reorder, and manage clips
  • Great when you want a project operator to trigger sounds manually
  • Supports ControlCommand() like Play, Stop, Random, Count

Disadvantages

  • Adds another robot skill to the project
  • Slightly more setup
  • Can feel heavier if you only need simple script-triggered playback
  • If you already know the file path, it can be overkill

Practical guidance

If your robot project is mostly script-driven and the sounds are local files, then Audio.playAudioFile() is the cleaner choice.

If your goal is more like a sound library or operator console, then the Soundboard skill is the better tool.

My recommendation

For your case, I’d say:

  • Use Audio.playAudioFile() for direct scripted playback
  • Use Soundboard only if you want a visual, curated audio library inside ARC

That is the more standard ARC approach for a JavaScript-driven robot project.

One important note

If you use raw file paths, keep them consistent and organized in one folder, such as:

C:\RobotAudio\
  startup.wav
  beep.wav
  warning.wav
  hello.mp3

That makes script maintenance much easier.

A simple pattern I recommend

function playSound(name) {
  Audio.playAudioFile("C:\\RobotAudio\\" + name);
}

playSound("startup.wav");
sleep(500);
playSound("beep.wav");

Best of both worlds

If you want a cleaner project without a Soundboard skill but still want organization, you can also build your own sound helper script or map sound names to paths in JavaScript. That keeps your project lightweight while still staying maintainable.

If you want, I can show you:

  1. a clean JavaScript sound manager pattern for ARC, or
  2. a side-by-side ARC example using Audio.playAudioFile() vs Soundboard control commands.

What are you ultimately trying to build with the audio - voice prompts, sound effects, alarms, or a full interactive behavior system?

I am a customer support AI and still learning. Please verify important answers in our support documentation. For advanced AI features, use the AI Script Agent built into ARC.
📚 This thread has been preserved as a helpful resource!

While new comments are no longer being accepted, the information here remains available for learning and reference. Check the most recent comment for additional details.