Advertisement
130s

sound_play/test.py_worksWell_11Dec06

Dec 10th, 2011
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. #!/usr/bin/env python
  2. PACKAGE_NAME = 'Package'
  3. NODE_NAME = 'PuddingSound'
  4. import roslib; roslib.load_manifest(PACKAGE_NAME)
  5. import rospy
  6. from sensor_msgs.msg import Joy
  7. from sound_play.msg import SoundRequest
  8. from sound_play.libsoundplay import SoundClient
  9. class SpeechDebug(object):
  10. def __init__(self):
  11. self.speechCount = 0
  12. self.voiceType = rospy.get_param(NODE_NAME + "/VOICE_TYPE", "voice_cmu_us_clb_arctic_clunits") # different voice source doesn't seem to make different to the issue.
  13. for i in range(0, 50):
  14. self.speak("You got pudding", self.voiceType)
  15. rospy.sleep(2)
  16. rospy.spin()
  17. def speak(self, text, voiceType):
  18. self.speechCount += 1
  19. text += " #" + str(self.speechCount)
  20. rospy.loginfo('Now saying: %s, count: %d' % (text, self.speechCount))
  21. self.soundhandle = SoundClient()
  22. self.soundhandle.say(text, voiceType)
  23. rospy.sleep(2)
  24. self.soundhandle.stopAll()
  25. if __name__ == '__main__':
  26. rospy.init_node('say', anonymous = True)
  27. j = SpeechDebug()
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement