Mercurial > hg > python-tutorial-skeleton
annotate test_audiofile.py @ 5:ea2387fd1b90 tip
Add CC0 disclaimers
author | Chris Cannam |
---|---|
date | Thu, 04 Oct 2012 22:12:02 +0100 |
parents | a8cde97eae7b |
children |
rev | line source |
---|---|
Chris@5 | 1 |
Chris@5 | 2 # To the extent possible under law, Chris Cannam and QMUL have waived |
Chris@5 | 3 # all copyright and related or neighboring rights to this file |
Chris@5 | 4 # (http://creativecommons.org/about/cc0) |
Chris@0 | 5 |
Chris@0 | 6 import audiofile as af |
Chris@0 | 7 |
Chris@0 | 8 def test_read_all_mono_from_file(): |
Chris@0 | 9 (samples, samplerate) = af.read_all_mono_samples_from_file('testfiles/4sample-stereo-ny.wav') |
Chris@0 | 10 assert samplerate == 44100 |
Chris@0 | 11 assert len(samples) == 4 |
Chris@0 | 12 assert samples[0] > 0.999 and samples[0] < 1 |
Chris@0 | 13 assert samples[1] == -1 |
Chris@0 | 14 assert samples[2] > 0.999 and samples[2] < 1 |
Chris@0 | 15 assert samples[3] == -1 |
Chris@0 | 16 |