feat: use voice shaping parameter
This commit is contained in:
@@ -118,11 +118,11 @@ class RobotConfig(object):
|
|||||||
"""
|
"""
|
||||||
Configuration of Pepper-specific parameters, like speech pitch.
|
Configuration of Pepper-specific parameters, like speech pitch.
|
||||||
|
|
||||||
:ivar pitch: The relative pitch offset of Pepper's voice, in relation to its base pitch.
|
:ivar voice_shaping: Pepper's voice shape, a number between 50 and 150. Defaults to 100.
|
||||||
:vartype pitch: float
|
:vartype voice_shaping: int
|
||||||
"""
|
"""
|
||||||
def __init__(self, pitch=None):
|
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):
|
class Settings(object):
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ class ActuationReceiver(ReceiverBase):
|
|||||||
|
|
||||||
if not self._tts_service:
|
if not self._tts_service:
|
||||||
self._tts_service = state.qi_session.service("ALTextToSpeech")
|
self._tts_service = state.qi_session.service("ALTextToSpeech")
|
||||||
self._tts_service.setParameter("pitchShift", settings.robot_config.pitch)
|
|
||||||
|
|
||||||
if message.get("is_priority"):
|
if message.get("is_priority"):
|
||||||
# Bypass queue and speak immediately
|
# Bypass queue and speak immediately
|
||||||
@@ -157,7 +156,7 @@ class ActuationReceiver(ReceiverBase):
|
|||||||
try:
|
try:
|
||||||
text = self._message_queue.get(timeout=0.1)
|
text = self._message_queue.get(timeout=0.1)
|
||||||
state.is_speaking = True
|
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:
|
except Queue.Empty:
|
||||||
state.is_speaking = False
|
state.is_speaking = False
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
|
|||||||
Reference in New Issue
Block a user