当前位置: 首页>>代码示例>>Python>>正文


Python SoundClient.waveSound方法代码示例

本文整理汇总了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')
开发者ID:osamazhar,项目名称:KURAbot,代码行数:16,代码来源:search_table+_beep.py

示例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)
开发者ID:78226415,项目名称:audio_common,代码行数:24,代码来源:soundclient_example.py

示例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"
开发者ID:BennyRe,项目名称:audio_common,代码行数:33,代码来源:test.py

示例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()
开发者ID:attilaachenbach,项目名称:cob_driver,代码行数:32,代码来源:test.py

示例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')
开发者ID:osamazhar,项目名称:KURAbot,代码行数:31,代码来源:sound_listener.py


注:本文中的sound_play.libsoundplay.SoundClient.waveSound方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。