source: python/tests/utils.py @ e1bfde5

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchpitchshiftsamplertimestretchyinfft+
Last change on this file since e1bfde5 was e1bfde5, checked in by Paul Brossier <piem@piem.org>, 8 years ago

tests/test_{source,sink}.py: add sink, improve source, use sounds in python/tests/sounds

  • Property mode set to 100644
File size: 453 bytes
Line 
1#! /usr/bin/env python
2
3def array_from_text_file(filename, dtype = 'float'):
4    import os.path
5    from numpy import array
6    filename = os.path.join(os.path.dirname(__file__), filename)
7    return array([line.split() for line in open(filename).readlines()],
8        dtype = dtype)
9
10def list_all_sounds(rel_dir):
11    import os.path, glob
12    datadir = os.path.join(os.path.dirname(__file__), rel_dir)
13    return glob.glob(os.path.join(datadir,'*.*'))
Note: See TracBrowser for help on using the repository browser.