feat: use voice shaping parameter

This commit is contained in:
Twirre Meulenbelt
2026-05-12 11:10:49 +02:00
parent e5425b04bc
commit 19f2720620
2 changed files with 4 additions and 5 deletions

View File

@@ -118,11 +118,11 @@ 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
:ivar voice_shaping: Pepper's voice shape, a number between 50 and 150. Defaults to 100.
:vartype voice_shaping: int
"""
def __init__(self, pitch=None):
self.pitch = get_config(pitch, "ROBOT__PITCH", 0.0, float)
self.voice_shaping = get_config(pitch, "ROBOT__VOICE_SHAPING", 100, int)
class Settings(object):

View File

@@ -68,7 +68,6 @@ 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
@@ -157,7 +156,7 @@ class ActuationReceiver(ReceiverBase):
try:
text = self._message_queue.get(timeout=0.1)
state.is_speaking = True
self._tts_service.say(text)
self._tts_service.say("\VCT={}\{}\RST\".format(settings.robot_config.voice_shaping, text))
except Queue.Empty:
state.is_speaking = False
except RuntimeError: