예제 #1
0
def sound_play_test_sound_and_note_mixed():
    n = Note('A')
    s = Sound(TEST_SOUND)
    n.play(duration=None)
    s.play()
    s.wait()
    n.stop()
    return True
예제 #2
0
def sound_play_test_sound_and_note_mixed():
    n = Note('A')
    s = Sound(TEST_SOUND)
    n.play(duration=None)
    s.play()
    s.wait()
    n.stop()
    return True
예제 #3
0
def sound_sound_volume():
    '''The long test sound will play for 10 second with increasing volume.  '''
    master_volume(100)
    s = Sound(TEST_SOUND_LONG)
    s.volume = 0
    s.play(duration=10)
    for i in range(20):
        s.volume += 15
        time.sleep(0.5)
    s.wait()
예제 #4
0
def sound_short_latency():
    s = Sound(TEST_SOUND)
    s.stop()
    start = time.time()
    s.play()
    s.wait()
    duration = time.time() - start
    latency = duration - TEST_SOUND_LENGTH
    print("Latency: ", latency)
    return latency > 0 and latency < 0.050
예제 #5
0
def sound_get_set_volume():
    # Verify Sound volume attribute can be get/set.
    s = Sound(TEST_SOUND_LONG)
    s.volume = 0
    s.play(duration=0.5)
    for i in range(10):
        s.volume += 10
        time.sleep(0.05)
    s.wait()
    return s.volume == 100
예제 #6
0
def sound_sound_volume():
    '''The long test sound will play for 10 second with increasing volume.  '''
    master_volume(100)
    s = Sound(TEST_SOUND_LONG)
    s.volume = 0
    s.play(duration=10)
    for i in range(20):
        s.volume += 15
        time.sleep(0.5)
    s.wait()
예제 #7
0
def sound_short_latency():
    s = Sound(TEST_SOUND)
    s.stop()
    start = time.time()
    s.play()
    s.wait()
    duration = time.time() - start
    latency = duration - TEST_SOUND_LENGTH
    print("Latency: ", latency)
    return latency > 0 and latency < 0.050
예제 #8
0
def sound_get_set_volume():
    # Verify Sound volume attribute can be get/set.
    s = Sound(TEST_SOUND_LONG)
    s.volume = 0
    s.play(duration=0.5)
    for i in range(10):
        s.volume += 10
        time.sleep(0.05)
    s.wait()
    return s.volume == 100
예제 #9
0
def sound_manual_play_test_sound_and_note_mixed():
    '''The sound match1.wav will play TWO TIMES on the speaker, mixed with an
    'A' note.
    '''
    n = Note('A')
    s = Sound(TEST_SOUND)
    n.play(duration=None)
    s.play()
    s.wait()
    s.play()
    s.wait()
    n.stop()
예제 #10
0
def sound_manual_play_test_sound_and_note_mixed():
    '''The sound match1.wav will play TWO TIMES on the speaker, mixed with an
    'A' note.
    '''
    n = Note('A')
    s = Sound(TEST_SOUND)
    n.play(duration=None)
    s.play()
    s.wait()
    s.play()
    s.wait()
    n.stop()
예제 #11
0
def sound_play_test_sound_loop_2():
    '''The sound match1.wav will play TWO TIMES on the speaker (about 0.5 seconds each).'''
    s = Sound(TEST_SOUND)
    s.play(loops=2)
    s.wait()
예제 #12
0
def sound_play_test_sound():
    '''The sound match1.wav will play on the speaker (about 0.5 seconds).'''
    s = Sound(TEST_SOUND)
    s.play()
    s.wait()
예제 #13
0
def sound_wait():
    s = Sound(TEST_SOUND)
    s.play()
    s.wait()
    return not s.is_playing()
예제 #14
0
def sound_play_test_sound_loop_2():
    '''The sound match1.wav will play TWO TIMES on the speaker (about 0.5 seconds each).'''
    s = Sound(TEST_SOUND)
    s.play(loops=2)
    s.wait()
예제 #15
0
def sound_play_test_sound():
    '''The sound match1.wav will play on the speaker (about 0.5 seconds).'''
    s = Sound(TEST_SOUND)
    s.play()
    s.wait()
예제 #16
0
def sound_wait():
    s = Sound(TEST_SOUND)
    s.play()
    s.wait()
    return not s.is_playing()