Skip to main content
Version: QTrobot V3

Speaker

The /qtrobot/speaker/... services control the robot's overall output volume — independent of TTS, audio, or video playback. These examples assume the gateway from Connection is already running.

Get and set volume

ros2 service call /qtrobot/speaker/volume/get qtrobot_interfaces/srv/SpeakerVolumeGet "{}"
ros2 service call /qtrobot/speaker/volume/set qtrobot_interfaces/srv/SpeakerVolumeSet "{value: 0.8}"

value ranges from 0.0 to 1.0. Like the Python and TypeScript SDKs, this maps onto the hardware volume curve, which isn't perceived linearly by ear — 0.5 will sound louder than half of 1.0.

Mute and unmute

ros2 service call /qtrobot/speaker/volume/mute qtrobot_interfaces/srv/SpeakerVolumeMute "{}"
ros2 service call /qtrobot/speaker/volume/unmute qtrobot_interfaces/srv/SpeakerVolumeUnmute "{}"

Muting doesn't change the stored volume value — volume/get still returns the same number, and unmute restores audio at that level.

Next steps

Continue with the Audio tutorial, or see the full speaker namespace in the ROS2 API Reference.