How can I route Stretch robot TTS audio to my PC speakers instead of the robot’s onboard speaker?

Hi everyone,

I am running stretch.app.ai_pickup with --use_llm and controlling the robot remotely from my workstation (Ubuntu PC).

By default, when the robot executes a "say" command, the audio plays from the robot’s onboard speaker.

I would like to instead hear all robot speech from my PC speakers (e.g., USB conference speaker connected to my workstation), not from the robot hardware.

Currently:

  • Robot is running the ROS2 bridge (run_stretch_ai_ros2_bridge_server.sh)

  • I run python -m stretch.app.ai_pickup --use_llm from my PC

Hi @Mallak_Alqaisi,

We’ve implemented a small update that allows routing the TTS audio to your workstation instead of the robot. It hasn’t been merged into the main branch yet, but you’re welcome to try it out.

To test this:

  1. On the robot side, everything remains the same, you can continue running the ROS2 bridge as usual:

    ./scripts/run_stretch_ai_ros2_bridge_server.sh
    
  2. On your GPU/workstation machine, go to your stretch_ai repo:

    cd ~/stretch_ai
    
  3. Fetch the latest changes and switch to the feature branch:

    git fetch
    git checkout feature/tts-output-target
    
  4. Run the app with the new flag:

    python -m stretch.app.ai_pickup --use_llm --tts_target pc
    

The new --tts_target option lets you choose where audio is played:

  • robot (default): audio plays from the robot speaker
  • pc: audio plays from your workstation speakers

So if you don’t set the flag, behavior remains unchanged.

One important note: audio will play through whatever output device your GPU/workstation is using, so make sure your USB speaker (or desired audio device) is connected and selected there.

Also, if you’re interested, here is the PR for this change.