It is possible to play audios on the roborio

My team wants to play audio on the robot during exhibitions, so I would like to know if this is possible, and if so, how?

It has no form of audio output to my knowledge. Just use a phone or something similar or put a bluetooth speaker on the robot.

1 Like

If you use falcons you could play a tune on them though…

4 Likes

We don’t have a falcon, so I would like to know if it is possible to do it through Roborio

There is no way to play audio through the roborio. Chirp files on a falcon is it and even then it’s just limited to essentially a Midi file. It’s not like a true speaker. Even then this can’t function while the motor is running because it is absurdly quiet and involves making noises with the motor controller beeps.

A phone or wireless speaker attached to a robot (not during competition) is your best bet. During competition you cannot play sounds from the robots. That’s explicitly in the rulebook which is why there isn’t really any FRC way of playing sounds. It’s not allowed in 99% of teams use cases.

R203 *General safety. ROBOT parts shall not be made from hazardous materials, be unsafe, cause an unsafe condition, or interfere with the operation of other ROBOTS. Examples of items that will violate this rule include (but are not limited to): … b. speakers, sirens, air horns, or other audio devices that generate sound at a level sufficient to be a distraction,

1 Like

Thanks, we’re trying to import an mp3 file into Rio that would send it to a speaker connected to Rio, but I think using something wireless is really the best option.

1 Like

I guess you could use a USB sound card to give it a way to output sound. I don’t know if the RIO image has the proper drivers for it though, and even then it would need Pipewire (or a similar Linux audio server) in order to be able to play anything.

They could also play sounds from an external SBC that talks to roborio like a raspberry pi. That will have the driver’s but it’s still not native to the rio and it assumes they have an SBC laying around.

I’ve also used an external sound board like Adafruit Sound Board which can be triggered from digital io from the roborio, arduinos, Jetson nano or even just plain on off switches. I used it for playing sound files when a magentic door sensor was tripped. Like someone opens a door and it chimes.

Still isn’t really a good answer though as it require more boards in the mix.

You could probably do everything remotely with JACK.

https://www.sparkfun.com/products/13720

We have sound on our parade robot, it’s a t-shirt shooting tank. We tried an MP3 trigger like @Joe_Ross suggested, but we found it to be too restrictive. It wasn’t loud enough, it only played one file at a time, and you couldn’t interrupt it (if I remember right.) Also, the SD Card slot broke almost immediately.

We ended up using a Raspberry Pi with an Amp HAT. The built-in jack is really intended for headphones or powered speakers, but you might be able to get by without the HAT for indoor use. We used NetworkTables to trigger the audio. We just had an entry for each audio file. The robot would update the entry to trigger the audio, and the code on the pi would play the file.

Here’s the code we ran on the raspberry pi
Here’s the command we ran the robot
We built it in 2021 and the code hasn’t been updated, so a couple things are out of date, but you can get the general idea. Python would also work perfectly well on the Raspberry Pi side, if that’s more your thing.

4 Likes

I’ve had this debate with some robot inspectors, is using that chirp method with Falcons legal? It’s not that hard to turn it off when the FMS is connected during match play to satisfy R203b, but could you run it while in the pits? Their argument is will you annoy your pit neighbors when the robot starts making constant sounds in the pit.

We actually wanted to do it for safety reasons, if a robot doesn’t have pneumatics, there is no real audio warning that the robot is live, so we thought about using falcons as that warning sound.

Not that it helps the OP, but just want to clarify that the falcon sounds are not made by the controller/any sort of speaker/buzzer but clever commutation of the motor itself.

1 Like

If that’s true then it cannot possibly run while the motors are being controlled to move otherwise then right? This effectively disables it from being used during a match then unless you want to sit still.

“commutation” might not be the right word here, but they have a way to do it while also allowing the motor to run freely: .chrp audio files for TalonFX music - #9 by ozrien

1 Like

Is it similar to how stepper motors are driven for sound https://youtu.be/6U8XAnVkJmI if so it’s actually moving the shaft of the motor in small amounts to make the sound. So you could either control the motion or the sound, but not both at once essentially. I’ve seen it on old floppy disk drives as well. Haven’t used it in a falcon though if it is somehow different.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.