@@ -829,29 +829,6 @@ async def get_network_state(self) -> protocol.NetworkStateResponse:
829829 get_network_state_request = protocol .NetworkStateRequest ()
830830 return await self .conn .grpc_interface .NetworkState (get_network_state_request )
831831
832- @connection .on_connection_thread ()
833- async def say_text (self , text : str , use_vector_voice : bool = True , duration_scalar : float = 1.0 ) -> protocol .SayTextResponse :
834- """Make Vector speak text.
835-
836- .. testcode::
837-
838- import anki_vector
839- with anki_vector.Robot() as robot:
840- robot.say_text("Hello World")
841-
842- :param text: The words for Vector to say.
843- :param use_vector_voice: Whether to use Vector's robot voice
844- (otherwise, he uses a generic human male voice).
845- :param duration_scalar: Adjust the relative duration of the
846- generated text to speech audio.
847-
848- :return: object that provides the status and utterance state
849- """
850- say_text_request = protocol .SayTextRequest (text = text ,
851- use_vector_voice = use_vector_voice ,
852- duration_scalar = duration_scalar )
853- return await self .conn .grpc_interface .SayText (say_text_request )
854-
855832
856833class AsyncRobot (Robot ):
857834 """The AsyncRobot object is just like the Robot object, but allows multiple commands
@@ -868,7 +845,7 @@ class AsyncRobot(Robot):
868845 # Create the robot connection
869846 with anki_vector.AsyncRobot() as robot:
870847 # Start saying text asynchronously
871- say_future = robot.say_text("Now is the time")
848+ say_future = robot.behavior. say_text("Now is the time")
872849 # Turn robot, wait for completion
873850 turn_future = robot.behavior.turn_in_place(degrees(3*360))
874851 turn_future.result()
@@ -890,7 +867,7 @@ class AsyncRobot(Robot):
890867 # Connect to Vector
891868 robot.connect()
892869 # Start saying text asynchronously
893- say_future = robot.say_text("Now is the time")
870+ say_future = robot.behavior. say_text("Now is the time")
894871 # Turn robot, wait for completion
895872 turn_future = robot.behavior.turn_in_place(degrees(3 * 360))
896873 turn_future.result()
0 commit comments