return NULL;
}
+ if (self->vec.length != self->win_s / 2 + 1) {
+ PyErr_Format(PyExc_ValueError,
+ "input cvec has length %d, but fft expects length %d",
+ self->vec.length, self->win_s / 2 + 1);
+ return NULL;
+ }
+
Py_INCREF(self->out);
if (!PyAubio_ArrayToCFvec(self->out, &(self->c_out))) {
return NULL;
f.set_mel_coeffs_slaney(16000)
assert_almost_equal ( expected, f.get_coeffs() )
+ def test_filterbank_long_cvec(self):
+ f = filterbank(40, 512)
+ with self.assertRaises(ValueError):
+ f(cvec(1024))
+
+ def test_filterbank_short_cvec(self):
+ f = filterbank(40, 512)
+ with self.assertRaises(ValueError):
+ f(cvec(256))
+
if __name__ == '__main__':
from nose2 import main
main()