Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -3,11 +3,15 @@ · 2 unmodified lines | |||
| 3 | import os | 3 | import os |
| 4 | import re | 4 | import re |
| 5 | import glob | 5 | import glob |
| 6 | import struct | ||
| 6 | import numpy as np | 7 | import numpy as np |
| 7 | from tempfile import mkstemp | 8 | from tempfile import mkstemp |
| 8 | 9 | ||
| 9 | DEFAULT_SOUND = '22050Hz_5s_brownnoise.wav' | 10 | DEFAULT_SOUND = '22050Hz_5s_brownnoise.wav' |
| 10 | 11 | ||
| 12 | def is32bit(): | ||
| 13 | return struct.calcsize("P") * 8 == 32 | ||
| 14 | |||
| 11 | def array_from_text_file(filename, dtype = 'float'): | 15 | def array_from_text_file(filename, dtype = 'float'): |
| 12 | realpathname = os.path.join(os.path.dirname(__file__), filename) | 16 | realpathname = os.path.join(os.path.dirname(__file__), filename) |
| 13 | return np.loadtxt(realpathname, dtype = dtype) | 17 | return np.loadtxt(realpathname, dtype = dtype) |