]
wave_array = subprocess.check_output(cmd)
for filename, n_samples in (('waveform.json', 200), ('waveform-500.json', 500)):
+ file_path = soundfile.get_format_path(filename)
+ if self.verbose:
+ print('creating', file_path)
# reduce to $n_samples$ samples of max positive value
if six.PY3:
wave_reduced = [
max(x)
for x in np.array_split(np.array([max(0, ord(x) - 128) for x in wave_array]), n_samples)
]
- file_path = soundfile.get_format_path(filename)
json.dump(wave_reduced, open(file_path, 'w'))