Exemplo n.º 1
0
def test_samples_per_beat():
    click = Click(filename, 44100, 60, False)
    assert click.samples_per_beat() == 44100

    click = Click(filename, 44100, 120, False)
    assert click.samples_per_beat() == 22050

    click = Click(filename, 22050, 120, False)
    assert click.samples_per_beat() == 11025
Exemplo n.º 2
0
def test_init_mono():
    click = Click(filename, 44100, 120, True)
    assert isinstance(click.audio, Mono)
    assert click.sr == 44100
    assert click.bpm == 120
    assert click.audio.data.shape == (click.samples_per_beat(), )
Exemplo n.º 3
0
def test_init_stereo():
    click = Click(filename, 44100, 120, False)
    assert isinstance(click.audio, Stereo)
    assert click.sr == 44100
    assert click.bpm == 120
    assert click.audio.data.shape == (2, click.samples_per_beat())