From a2f31bc0abe16d7155bc9589126ec1915d30e7ac Mon Sep 17 00:00:00 2001 From: Fabien Danieau Date: Wed, 15 Nov 2023 16:44:28 +0100 Subject: [PATCH] enhancement #123: adding say text --- src/reachy_v2_sdk/audio.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/reachy_v2_sdk/audio.py b/src/reachy_v2_sdk/audio.py index 4bbcf754..f0c63abc 100644 --- a/src/reachy_v2_sdk/audio.py +++ b/src/reachy_v2_sdk/audio.py @@ -12,6 +12,7 @@ RecordingRequest, SoundId, SoundRequest, + TextRequest, VolumeRequest, ) from reachy_sdk_api_v2.sound_pb2_grpc import SoundServiceStub @@ -70,3 +71,6 @@ def set_audio_volume(self, volume: float) -> None: if not 0 <= volume <= 1: raise ValueError(f"Volume should be between 0 and 1, got {volume}") self._audio_stub.ChangeVolume(VolumeRequest(id=self._speaker_id, volume=volume)) + + def say_text(self, text: str) -> None: + self._audio_stub.SayText(TextRequest(text=text))