當前位置: 首頁>>代碼示例>>Python>>正文


Python Sound.is_playing方法代碼示例

本文整理匯總了Python中rstem.sound.Sound.is_playing方法的典型用法代碼示例。如果您正苦於以下問題:Python Sound.is_playing方法的具體用法?Python Sound.is_playing怎麽用?Python Sound.is_playing使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rstem.sound.Sound的用法示例。


在下文中一共展示了Sound.is_playing方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: sound_not_is_playing_after_play

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_not_is_playing_after_play():
    s = Sound(TEST_SOUND)
    print("before play")
    s.play()
    print("after play")
    time.sleep(TEST_SOUND_LENGTH + 0.5)
    print("after wait: ", s.is_playing())
    return not s.is_playing()
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:10,代碼來源:test_speaker.py

示例2: sound_play_then_replay

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_play_then_replay():
    s = Sound(TEST_SOUND_LONG)
    s.play()
    time.sleep(0.5)
    playing_firsttime = s.is_playing()
    s.play(duration=1.0)
    time.sleep(0.5)
    playing_secondtime_before_end = s.is_playing()
    time.sleep(1.0)
    playing_secondtime_after_end = s.is_playing()
    s.stop()
    print('playing_firsttime: ', playing_firsttime)
    print('playing_secondtime_before_end: ', playing_secondtime_before_end)
    print('playing_secondtime_after_end: ', playing_secondtime_after_end)
    return playing_firsttime and playing_secondtime_before_end and not playing_secondtime_after_end
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:17,代碼來源:test_speaker.py

示例3: sound_not_playing_after_end_of_2_loops_of_fixed_duration

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_not_playing_after_end_of_2_loops_of_fixed_duration():
    s = Sound(TEST_SOUND_LONG)
    s.play(duration=1.0, loops=2)
    time.sleep(2.5)
    playing = s.is_playing()
    s.stop()
    return not playing
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:9,代碼來源:test_speaker.py

示例4: sound_not_playing_after_end_of_2_loops

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_not_playing_after_end_of_2_loops():
    s = Sound(TEST_SOUND)
    s.play(loops=2)
    time.sleep(TEST_SOUND_LENGTH * 2 + 0.5)
    playing = s.is_playing()
    s.stop()
    return not playing
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:9,代碼來源:test_speaker.py

示例5: sound_playing_before_end_of_2_loops

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_playing_before_end_of_2_loops():
    s = Sound(TEST_SOUND)
    s.play(loops=2)
    time.sleep(TEST_SOUND_LENGTH * 2 - 0.5)
    playing = s.is_playing()
    s.stop()
    return playing
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:9,代碼來源:test_speaker.py

示例6: sound_playing_before_end_of_duration_play

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_playing_before_end_of_duration_play():
    s = Sound(TEST_SOUND_LONG)
    s.play(duration=1.0)
    time.sleep(0.5)
    playing = s.is_playing()
    s.stop()
    return playing
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:9,代碼來源:test_speaker.py

示例7: sound_playing_before_end_of_2_loops_of_fixed_duration

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_playing_before_end_of_2_loops_of_fixed_duration():
    s = Sound(TEST_SOUND_LONG)
    s.play(duration=1.0, loops=2)
    playing = s.is_playing()
    s.stop()
    return playing
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:8,代碼來源:test_speaker.py

示例8: sound_not_playing_after_end_of_duration_play

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_not_playing_after_end_of_duration_play():
    s = Sound(TEST_SOUND_LONG)
    s.play(duration=1.0)
    time.sleep(1.5)
    return not s.is_playing()
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:7,代碼來源:test_speaker.py

示例9: sound_stop

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_stop():
    s = Sound(TEST_SOUND)
    s.play()
    s.stop()
    return not s.is_playing()
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:7,代碼來源:test_speaker.py

示例10: sound_wait

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_wait():
    s = Sound(TEST_SOUND)
    s.play()
    s.wait()
    return not s.is_playing()
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:7,代碼來源:test_speaker.py

示例11: sound_is_playing_at_play_middle

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_is_playing_at_play_middle():
    s = Sound(TEST_SOUND)
    s.play()
    time.sleep(TEST_SOUND_LENGTH/2)
    return s.is_playing()
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:7,代碼來源:test_speaker.py

示例12: sound_is_playing_at_play_start

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_is_playing_at_play_start():
    s = Sound(TEST_SOUND)
    s.play()
    return s.is_playing()
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:6,代碼來源:test_speaker.py

示例13: sound_not_is_playing_before_play

# 需要導入模塊: from rstem.sound import Sound [as 別名]
# 或者: from rstem.sound.Sound import is_playing [as 別名]
def sound_not_is_playing_before_play():
    s = Sound(TEST_SOUND)
    return not s.is_playing()
開發者ID:readysetstem,項目名稱:readysetstem-api,代碼行數:5,代碼來源:test_speaker.py


注:本文中的rstem.sound.Sound.is_playing方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。