From 485dee8c39574c1a2259b71e106475e6ec0c41ee Mon Sep 17 00:00:00 2001 From: Kasper Marinus Date: Mon, 11 May 2026 16:04:24 +0200 Subject: [PATCH] feat: pitch setting --- src/robot_interface/core/config.py | 16 +++++++++++++++- .../endpoints/actuation_receiver.py | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/robot_interface/core/config.py b/src/robot_interface/core/config.py index 3a19c48..38ed902 100644 --- a/src/robot_interface/core/config.py +++ b/src/robot_interface/core/config.py @@ -114,6 +114,17 @@ class MainConfig(object): self.max_handler_time_ms = get_config(max_handler_time_ms, "MAIN__MAX_HANDLER_TIME_MS", 50, int) +class RobotConfig(object): + """ + Configuration of Pepper-specific parameters, like speech pitch. + + :ivar pitch: The relative pitch offset of Pepper's voice, in relation to its base pitch. + :vartype pitch: float + """ + def __init__(self, pitch=None): + self.pitch = get_config(pitch, "ROBOT_PITCH", 0.0, float) + + class Settings(object): """ Global settings container. @@ -126,12 +137,15 @@ class Settings(object): :vartype audio_config: AudioConfig :ivar main_config: Main system-level configuration. :vartype main_config: MainConfig + :ivar robot_config: Robot configuration. + :vartype robot_config: RobotConfig """ - def __init__(self, agent_settings=None, video_config=None, audio_config=None, main_config=None): + def __init__(self, agent_settings=None, video_config=None, audio_config=None, main_config=None, robot_config=None): self.agent_settings = agent_settings or AgentSettings() self.video_config = video_config or VideoConfig() self.audio_config = audio_config or AudioConfig() self.main_config = main_config or MainConfig() + self.robot_config = robot_config or RobotConfig() settings = Settings() diff --git a/src/robot_interface/endpoints/actuation_receiver.py b/src/robot_interface/endpoints/actuation_receiver.py index 1e31f38..00c246a 100644 --- a/src/robot_interface/endpoints/actuation_receiver.py +++ b/src/robot_interface/endpoints/actuation_receiver.py @@ -68,6 +68,7 @@ class ActuationReceiver(ReceiverBase): if not self._tts_service: self._tts_service = state.qi_session.service("ALTextToSpeech") + self._tts_service.setParameter("pitchShift", settings.robot_config.pitch) if message.get("is_priority"): # Bypass queue and speak immediately