Skip to content

Commit

Permalink
Merge pull request #131 from pollen-robotics/123-add-text-to-speech-m…
Browse files Browse the repository at this point in the history
…ethod

enhancement #123: adding say text
  • Loading branch information
simheo authored Nov 17, 2023
2 parents 687a7c5 + eb08915 commit e91cfe6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/reachy2_sdk/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
RecordingRequest,
SoundId,
SoundRequest,
TextRequest,
VolumeRequest,
)
from reachy2_sdk_api.sound_pb2_grpc import SoundServiceStub
Expand Down Expand Up @@ -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))

0 comments on commit e91cfe6

Please sign in to comment.