Exemplo n.º 1
0
def test_buffer_data(buf):
    assert buf.is_valid
    audio_source = Silence(1.)
    buf.data(
        audio_source.get_audio_data(
            audio_source.audio_format.bytes_per_second),
        audio_source.audio_format)
    assert buf.is_valid
    buf.delete()
    assert not buf.is_valid
Exemplo n.º 2
0
def filled_buffer(source):
    buf = source.get_buffer()
    assert buf.is_valid
    audio_source = Silence(1.)
    buf.data(
        audio_source.get_audio_data(
            audio_source.audio_format.bytes_per_second),
        audio_source.audio_format)
    yield buf
    source.buffer_pool.unqueue_buffer(buf)
Exemplo n.º 3
0
def test_multiple_fire_and_forget_players():
    """
    Test an issue where the driver crashed when starting multiple players, but not
    keeping a reference to these players.
    """
    for _ in range(10):
        Silence(1).play()
    time.sleep(1)
Exemplo n.º 4
0
def audio_source():
    return Silence(10.0, 44100, 16)
Exemplo n.º 5
0
def test_create_audio_player(driver, player):
    source = Silence(1.)
    audio_player = driver.create_audio_player(source, player)
    audio_player.delete()