Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- PACKAGE_NAME = 'Package'
- NODE_NAME = 'PuddingSound'
- import roslib; roslib.load_manifest(PACKAGE_NAME)
- import rospy
- from sensor_msgs.msg import Joy
- from sound_play.msg import SoundRequest
- from sound_play.libsoundplay import SoundClient
- class SpeechDebug(object):
- def __init__(self):
- self.speechCount = 0
- 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.
- for i in range(0, 50):
- self.speak("You got pudding", self.voiceType)
- rospy.sleep(2)
- rospy.spin()
- def speak(self, text, voiceType):
- self.speechCount += 1
- text += " #" + str(self.speechCount)
- rospy.loginfo('Now saying: %s, count: %d' % (text, self.speechCount))
- self.soundhandle = SoundClient()
- self.soundhandle.say(text, voiceType)
- rospy.sleep(2)
- self.soundhandle.stopAll()
- if __name__ == '__main__':
- rospy.init_node('say', anonymous = True)
- j = SpeechDebug()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement