Esempio n. 1
0
        exit(-1)

    # Import after printing usage for speed.
    import roslib; roslib.load_manifest('cordial_sound')
    import rospy
    from cordial_sound.msg import SoundRequest
    from cordial_sound.libsoundplay import SoundClient
    
    if len(sys.argv) == 1:
        print 'Awaiting something to say on standard input.'
    
    # Ordered this way to minimize wait time.
    rospy.init_node('say', anonymous = True)
    soundhandle = SoundClient()
    rospy.sleep(1)

    voice = 'voice_kal_diphone'
    
    if len(sys.argv) == 1:
        s = sys.stdin.read()
    else:
      s = sys.argv[1]
      if len(sys.argv) == 3:
        voice = sys.argv[2]
   
    print 'Saying: %s' % s
    print 'Voice: %s' % voice
    
    soundhandle.say(s,voice)
    rospy.sleep(1)