本文整理汇总了Python中sound_play.libsoundplay.SoundClient.waveSound方法的典型用法代码示例。如果您正苦于以下问题:Python SoundClient.waveSound方法的具体用法?Python SoundClient.waveSound怎么用?Python SoundClient.waveSound使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sound_play.libsoundplay.SoundClient
的用法示例。
在下文中一共展示了SoundClient.waveSound方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from sound_play.libsoundplay import SoundClient [as 别名]
# 或者: from sound_play.libsoundplay.SoundClient import waveSound [as 别名]
def __init__(self):
State.__init__(self, outcomes=['detect','not_detect'])
rospy.Subscriber("ar_pose_marker", AlvarMarkers, self.my_listener)
self.n_markers = 0
self.table_flag = False
self.execute_flag = False
self.sum_x = 0
self.counter = 0
self.mean_distance = 0
soundhandle = SoundClient()
self.detect_tableorder = soundhandle.waveSound('/home/mscv/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/sound/smb_1-up.wav')
示例2: play_explicit
# 需要导入模块: from sound_play.libsoundplay import SoundClient [as 别名]
# 或者: from sound_play.libsoundplay.SoundClient import waveSound [as 别名]
def play_explicit():
rospy.loginfo('Example: SoundClient play methods can take in an explicit'
' blocking parameter')
soundhandle = SoundClient() # blocking = False by default
rospy.sleep(0.5) # Ensure publisher connection is successful.
sound_beep = soundhandle.waveSound("say-beep.wav", volume=0.5)
# Play the same sound twice, once blocking and once not. The first call is
# blocking (explicitly specified).
sound_beep.play(blocking=True)
# This call is not blocking (uses the SoundClient's setting).
sound_beep.play()
rospy.sleep(0.5) # Let sound complete.
# Play a blocking sound.
soundhandle.play(SoundRequest.NEEDS_UNPLUGGING, blocking=True)
# Create a new SoundClient where the default behavior *is* to block.
soundhandle = SoundClient(blocking=True)
soundhandle.say('Say-ing stuff while block-ing')
soundhandle.say('Say-ing stuff without block-ing', blocking=False)
rospy.sleep(1)
示例3: sleep
# 需要导入模块: from sound_play.libsoundplay import SoundClient [as 别名]
# 或者: from sound_play.libsoundplay.SoundClient import waveSound [as 别名]
sleep(2)
print 'unplugging'
soundhandle.play(SoundRequest.NEEDS_UNPLUGGING)
sleep(2)
print 'plugging badly'
soundhandle.play(SoundRequest.NEEDS_PLUGGING_BADLY)
sleep(2)
print 'unplugging badly'
soundhandle.play(SoundRequest.NEEDS_UNPLUGGING_BADLY)
sleep(2)
s1 = soundhandle.builtinSound(SoundRequest.NEEDS_UNPLUGGING_BADLY)
s2 = soundhandle.waveSound("say-beep.wav")
s3 = soundhandle.voiceSound("Testing the new A P I")
print "New API start voice"
s3.repeat()
sleep(3)
print "New API wave"
s2.play()
sleep(2)
print "New API builtin"
s1.play()
sleep(2)
print "New API stop"
示例4: sleep
# 需要导入模块: from sound_play.libsoundplay import SoundClient [as 别名]
# 或者: from sound_play.libsoundplay.SoundClient import waveSound [as 别名]
print 'unplugging'
soundhandle.play(SoundRequest.NEEDS_UNPLUGGING)
sleep(1)
print 'plugging badly'
soundhandle.play(SoundRequest.NEEDS_PLUGGING_BADLY)
sleep(1)
#stop(SoundRequest.BACKINGUP)
sleep(2)
print 'unplugging badly'
soundhandle.play(SoundRequest.NEEDS_UNPLUGGING_BADLY)
sleep(3)
s1 = soundhandle.builtinSound(SoundRequest.NEEDS_UNPLUGGING_BADLY)
s2 = soundhandle.waveSound("/usr/share/xemacs21/xemacs-packages/etc/sounds/say-beep.wav")
s3 = soundhandle.voiceSound("Testing the new A P I")
print "New API start voice"
s3.repeat()
sleep(2)
print "New API wave"
s2.play()
sleep(2)
print "New API builtin"
s1.play()
sleep(2)
print "New API stop"
s3.stop()
示例5: __init__
# 需要导入模块: from sound_play.libsoundplay import SoundClient [as 别名]
# 或者: from sound_play.libsoundplay.SoundClient import waveSound [as 别名]
def __init__(self):
rospy.init_node('my_soundmsgs_listener', anonymous=True)
rospy.Subscriber('sound_message', String, self.my_callback_function)
soundhandle = SoundClient()
self.sound1 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/sound/smb_coin.wav')
self.sound2 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/sound/smb_1-up.wav')
self.sound3 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/sound/smb_stage_clear.wav')
self.sound4 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/sound/smb_mariodie.wav')
self.sound5 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/sound/smb_powerup.wav')
self.welcome = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/welcome.wav')
self.waiting_order = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/waiting_order.wav')
self.O1 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/O1.wav')
self.O2 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/O2.wav')
self.O3 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/O3.wav')
self.O4 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/O4.wav')
self.O5 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/O5.wav')
self.O6 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/O6.wav')
self.M1 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/M1.wav')
self.M2 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/M2.wav')
self.M3 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/M3.wav')
self.M4 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/M4.wav')
self.M5 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/M5.wav')
self.M6 = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/M6.wav')
self.table_search = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/table_search.wav')
self.thanks = soundhandle.waveSound('/home/turtlebot/ros/hydro/catkin_ws/src/rbx2/rbx2_tasks/new_sound_wav/thanks.wav')