Example #1
0
def test_wavwrite():
    frames = np.array([[0.5]])
    framerate = 44100
    f = StringIO()
    io.wavwrite(f, frames, framerate)
    f.seek(0)
    data, fs = io.wavread(f)
    assert_almost_equal(data, frames)
    assert_equal(fs, framerate)
    f = StringIO()
    io.wavwrite(f, data, fs)
    f.seek(0)
    frames, fs = io.wavread(f)
    assert_almost_equal(data, frames)
Example #2
0
def test_wavread():
    f = gen_test_wav()
    frames, framerate = io.wavread(f)
    assert_almost_equal(frames, [[0.5]], 3)
    assert_equal(framerate, 44100)