40 from sound_play.msg
import SoundRequest
50 if __name__ ==
'__main__':
51 rospy.init_node(
'soundplay_test', anonymous =
True)
58 rospy.loginfo(
"This script will run continuously until you hit CTRL+C, testing various sound_node sound types.")
69 soundhandle.playWave(
'say-beep.wav')
72 rospy.loginfo(
'quiet wave')
73 soundhandle.playWave(
'say-beep.wav', 0.3)
76 rospy.loginfo(
'plugging')
77 soundhandle.play(SoundRequest.NEEDS_PLUGGING)
80 rospy.loginfo(
'quiet plugging')
81 soundhandle.play(SoundRequest.NEEDS_PLUGGING, 0.3)
84 rospy.loginfo(
'unplugging')
85 soundhandle.play(SoundRequest.NEEDS_UNPLUGGING)
88 rospy.loginfo(
'plugging badly')
89 soundhandle.play(SoundRequest.NEEDS_PLUGGING_BADLY)
92 rospy.loginfo(
'unplugging badly')
93 soundhandle.play(SoundRequest.NEEDS_UNPLUGGING_BADLY)
96 s1 = soundhandle.builtinSound(SoundRequest.NEEDS_UNPLUGGING_BADLY)
97 s2 = soundhandle.waveSound(
"say-beep.wav")
98 s3 = soundhandle.voiceSound(
"Testing the new A P I")
99 s4 = soundhandle.builtinSound(SoundRequest.NEEDS_UNPLUGGING_BADLY, 0.3)
100 s5 = soundhandle.waveSound(
"say-beep.wav", 0.3)
101 s6 = soundhandle.voiceSound(
"Testing the new A P I", 0.3)
103 rospy.loginfo(
"New API start voice")
107 rospy.loginfo(
"New API start voice quiet")
111 rospy.loginfo(
"New API wave")
115 rospy.loginfo(
"New API wave quiet")
119 rospy.loginfo(
"New API builtin")
123 rospy.loginfo(
"New API builtin quiet")
127 rospy.loginfo(
"New API stop")