示例#1
0
int main ()
{
  aubio_filter_t * f;

  uint_t rates[] = { 8000, 16000, 22050, 44100, 96000, 192000};
  uint_t nrates = 6;
  uint_t samplerate, i = 0;

  for ( samplerate = rates[i]; i < nrates ; i++ ) {
    f = new_aubio_filter_c_weighting (samplerate);
    del_aubio_filter (f);

    f = new_aubio_filter (5);
    aubio_filter_set_c_weighting (f, samplerate);
    del_aubio_filter (f);
  }

  // samplerate unknown
  f = new_aubio_filter_c_weighting (4200);
  del_aubio_filter (f);

  // order to small
  f = new_aubio_filter (2);
  aubio_filter_set_c_weighting (f, samplerate);
  del_aubio_filter (f);

  // order to big
  f = new_aubio_filter (12);
  aubio_filter_set_c_weighting (f, samplerate);
  del_aubio_filter (f);

  return 0;
}
示例#2
0
aubio_filter_t * new_aubio_filter_c_weighting (uint_t samplerate) {
  aubio_filter_t * f = new_aubio_filter(5);
  if (aubio_filter_set_c_weighting(f,samplerate) != AUBIO_OK) {
    del_aubio_filter(f);
    return NULL;
  }
  return f;
}
示例#3
0
static PyObject * 
Py_filter_set_c_weighting (Py_filter * self, PyObject *args)
{
  uint_t err = 0;
  uint_t samplerate;
  if (!PyArg_ParseTuple (args, "I", &samplerate)) {
    return NULL;
  }

  err = aubio_filter_set_c_weighting (self->o, samplerate);
  if (err > 0) {
    PyErr_SetString (PyExc_ValueError,
        "error when setting filter to C-weighting");
    return NULL;
  }
  Py_RETURN_NONE;
}
示例#4
0
aubio_filter_t * new_aubio_filter_c_weighting (uint_t samplerate) {
  aubio_filter_t * f = new_aubio_filter(5);
  aubio_filter_set_c_weighting (f, samplerate);
  return f;
}