示例#1
0
def test_echo_small():
    inp = {'rate': 9, 'left': [1, 2, 3], 'right': [0, 4, 0]}
    inp2 = copy.deepcopy(inp)
    exp = {
        'rate': 9,
        'left': [1, 2, 3, 0, 0, 0.7, 1.4, 2.1, 0, 0, 0.49, 0.98, 1.47],
        'right': [0, 4, 0, 0, 0, 0, 2.8, 0, 0, 0, 0, 1.96, 0],
    }
    compare_sounds(lab.echo(inp, 2, 0.6, 0.7), exp)
    assert inp == inp2, 'be careful not to modify the inputs!'
示例#2
0
def test_echo_random_2():
    inps, exp = load_pickle_pair('echo_02.pickle')
    inps2 = copy.deepcopy(inps)
    compare_sounds(lab.echo(*inps), exp)
    assert inps == inps2, 'be careful not to modify the inputs!'
示例#3
0
def test_echo_real():
    inp = lab.load_wav(os.path.join(TEST_DIRECTORY, 'sounds', 'synth.wav'))
    inp2 = copy.deepcopy(inp)
    outfile = os.path.join(TEST_DIRECTORY, 'test_outputs', 'synth_echo.wav')
    compare_against_file(lab.echo(inp, 6, 0.5, 0.7), outfile)
    assert inp == inp2, 'be careful not to modify the input!'