Docs›Two-way Audio

Two-way Audio

Two-way audio lets you talk to people near the robot and hear them in real time during a teleop session. Audio is carried over the same WebRTC connection as video and is gated by a push-to-talk button on the operator side.

Overview

  • Operator → robot: your browser captures your microphone and sends it to the robot's speakers.
  • Robot → operator: the robot captures its microphone and sends it to your browser.
  • Push-to-talk: the operator mic is muted by default. Hold Space (or press the on-screen mic button) to transmit.
Capability gate

Audio support is built into every agent, but it depends on ALSA and GStreamer being available on the robot. The agent must be restarted after toggling audio.enabled.

Audio format

Audio is encoded with Opus at 48 kHz, stereo on capture, 20 ms frames at 24 kbit/s, carried over WebRTC with a 60 ms jitter buffer on the robot's playback side.

Hardware Setup

To use two-way audio, the robot needs a microphone and speakers connected to its host computer:

  • Microphone—USB mic, USB headset, or 3.5mm mic plugged into the robot's audio input.
  • Speakers—USB speakers, the robot's built-in audio jack, or a Bluetooth/HDMI output (anything ALSA can route to).

Plug the devices in before starting the agent so ALSA enumerates them at startup. If you add a device after the agent is running, restart the agent.

Enabling Audio

Open the robot's Edit Robot page (or Robot Setup during initial setup), connect the configuration session, and look for the Audio group in the live config table.

  • Set Two-way Voice to Enabled.
  • Restart the agent for the change to take effect—the audio pipeline is wired up at startup, not on the fly. From the robot host:
sudo systemctl restart ctrlr-agent   # apt install (the default)
docker restart ctrlr-agent           # Docker install

If you don't restart, the toggle will save but no audio will flow.

Selecting Devices

By default the agent uses GStreamer's auto-detect: autoaudiosrc for the mic and autoaudiosink for speakers. That works on many robots, but if you need a specific device (e.g. a USB mic when the robot also has an HDMI input it would otherwise prefer), set the Microphone Device and Speaker Device fields to ALSA device names.

To list available devices, run on the robot:

arecord -L   # list inputs (microphones)
aplay -L     # list outputs (speakers)

Pick the name you want (typically a plughw:CARD=<name>,DEV=<n> entry—the plughw form lets ALSA convert sample rates if needed), paste it into the matching field in the webapp, and press Enter to save.

Tip

If arecord -L shows a long list, the ones you usually want are the plughw:CARD=... entries for the physical device you plugged in, or the default alias if your system is already configured to route to it.

Using It In a Session

  • Start a teleop session for the robot.
  • Click the microphone button in the session controls. The first time, the browser will prompt you for microphone permission—accept it.
  • The mic stays muted until you transmit. To talk:
    • Hold Space—push-to-talk. Mic transmits while held, mutes on release.
    • Click the mic button—latches transmit on; click again to mute.
  • Robot audio plays automatically through your browser once the session connects.
No audio?

Check that audio.enabled is true and the agent was restarted afterward; verify the device names with arecord -L / aplay -L; and confirm browser microphone permission isn't blocked for the CTRL+R site.