Skip to content
Snippets Groups Projects
Commit bef9c0da authored by Antonio Andriella's avatar Antonio Andriella
Browse files

code refactoring

parent d87a52ec
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,7 @@ class Speech(): ...@@ -41,6 +41,7 @@ class Speech():
def doneCb(self, state, result): def doneCb(self, state, result):
rospy.loginfo("Action server is done.") rospy.loginfo("Action server is done.")
self.reproduction_has_ended = True self.reproduction_has_ended = True
return self.reproduction_has_ended
def text_to_speech(self, text, locked=False): def text_to_speech(self, text, locked=False):
...@@ -61,18 +62,7 @@ class Speech(): ...@@ -61,18 +62,7 @@ class Speech():
if __name__ == "__main__": if __name__ == "__main__":
speech = Speech("en_GB") speech = Speech("en_GB")
text = "The solution is 112" text = "Hola"
speech.text_to_speech(text, True) speech.text_to_speech(text, True)
print(speech.reproduction_has_ended) print(speech.reproduction_has_ended)
speech.reproduction_has_ended = False
print(speech.reproduction_has_ended)
if speech.reproduction_has_ended == False:
speech.text_to_speech(text, True)
print(speech.reproduction_has_ended)
#
# t0 = time.time()
# elapsed_time = 0
# while(elapsed_time<5):
# elapsed_time = time.time()-t0
# print("Reproduction has ended? ",speech.reproduction_has_ended)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment