40 from sound_play.msg
import SoundRequest
50 if __name__ ==
'__main__':
51 rospy.init_node(
'soundplay_test', anonymous =
True)
58 print "This script will run continuously until you hit CTRL+C, testing various sound_node sound types." 70 soundhandle.playWave(
'say-beep.wav')
74 soundhandle.playWave(
'say-beep.wav', 0.3)
78 soundhandle.play(SoundRequest.NEEDS_PLUGGING)
81 print 'quiet plugging' 82 soundhandle.play(SoundRequest.NEEDS_PLUGGING, 0.3)
86 soundhandle.play(SoundRequest.NEEDS_UNPLUGGING)
89 print 'plugging badly' 90 soundhandle.play(SoundRequest.NEEDS_PLUGGING_BADLY)
93 print 'unplugging badly' 94 soundhandle.play(SoundRequest.NEEDS_UNPLUGGING_BADLY)
97 s1 = soundhandle.builtinSound(SoundRequest.NEEDS_UNPLUGGING_BADLY)
98 s2 = soundhandle.waveSound(
"say-beep.wav")
99 s3 = soundhandle.voiceSound(
"Testing the new A P I")
100 s4 = soundhandle.builtinSound(SoundRequest.NEEDS_UNPLUGGING_BADLY, 0.3)
101 s5 = soundhandle.waveSound(
"say-beep.wav", 0.3)
102 s6 = soundhandle.voiceSound(
"Testing the new A P I", 0.3)
104 print "New API start voice" 108 print "New API start voice quiet" 116 print "New API wave quiet" 120 print "New API builtin" 124 print "New API builtin quiet"
This class is a helper class for communicating with the sound_play node via the sound_play.SoundRequest message.