Changes in / [c1ba75b:adc6e02]


Ignore:
Files:
5 deleted
25 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    rc1ba75b radc6e02  
    66*.gcno
    77*.gcda
    8 python/lib/aubio/_aubio.*.so
    9 .coverage
    108
    119# ignore compiled examples
  • doc/python.rst

    rc1ba75b radc6e02  
    3131   py_datatypes
    3232   py_io
    33    py_temporal
    34    py_spectral
    35    py_analysis
    36    py_synth
    3733   py_utils
    3834   py_examples
  • examples/aubiomfcc.c

    rc1ba75b radc6e02  
    6969  }
    7070
    71   examples_common_process(process_block, process_print);
     71  examples_common_process((aubio_process_func_t)process_block, process_print);
    7272
    7373  del_aubio_pvoc (pv);
  • examples/aubionotes.c

    rc1ba75b radc6e02  
    9191  }
    9292
    93   examples_common_process(process_block, process_print);
     93  examples_common_process((aubio_process_func_t)process_block, process_print);
    9494
    9595  // send a last note off if required
  • examples/aubioonset.c

    rc1ba75b radc6e02  
    8787  //aubio_sampler_load (sampler, "/archives/sounds/woodblock.aiff");
    8888
    89   examples_common_process(process_block, process_print);
     89  examples_common_process((aubio_process_func_t)process_block, process_print);
    9090
    9191  // send a last note off
  • examples/aubiopitch.c

    rc1ba75b radc6e02  
    8080  aubio_wavetable_play ( wavetable );
    8181
    82   examples_common_process(process_block, process_print);
     82  examples_common_process((aubio_process_func_t)process_block,process_print);
    8383
    8484  del_aubio_pitch (o);
  • examples/aubioquiet.c

    rc1ba75b radc6e02  
    5656  verbmsg ("buffer_size: %d, ", buffer_size);
    5757  verbmsg ("hop_size: %d\n", hop_size);
    58   examples_common_process(process_block, process_print);
     58  examples_common_process((aubio_process_func_t)process_block,process_print);
    5959  examples_common_del();
    6060  return 0;
  • examples/aubiotrack.c

    rc1ba75b radc6e02  
    8888  //aubio_sampler_load (sampler, "/archives/sounds/woodblock.aiff");
    8989
    90   examples_common_process(process_block, process_print);
     90  examples_common_process((aubio_process_func_t)process_block,process_print);
    9191
    9292  // send a last note off
  • python/ext/aubio-types.h

    rc1ba75b radc6e02  
    22#include <structmember.h>
    33
    4 #include "aubio-docstrings.h"
    54#include "aubio-generated.h"
    65
  • python/ext/py-fft.c

    rc1ba75b radc6e02  
    11#include "aubio-types.h"
    22
    3 static char Py_fft_doc[] = ""
    4 "fft(size=1024)\n"
    5 "\n"
    6 "Compute Fast Fourier Transorms.\n"
    7 "\n"
    8 "Parameters\n"
    9 "----------\n"
    10 "size : int\n"
    11 "    size of the FFT to compute\n"
    12 "\n"
    13 "Example\n"
    14 "-------\n"
    15 ">>> x = aubio.fvec(512)\n"
    16 ">>> f = aubio.fft(512)\n"
    17 ">>> c = f(x); c\n"
    18 "aubio cvec of 257 elements\n"
    19 ">>> x2 = f.rdo(c); x2.shape\n"
    20 "(512,)\n"
    21 "";
     3static char Py_fft_doc[] = "fft object";
    224
    235typedef struct
  • python/ext/py-filter.c

    rc1ba75b radc6e02  
    1111} Py_filter;
    1212
    13 static char Py_filter_doc[] = ""
    14 "digital_filter(order=7)\n"
    15 "\n"
    16 "Create a digital filter.\n"
    17 "";
    18 
    19 static char Py_filter_set_c_weighting_doc[] = ""
    20 "set_c_weighting(samplerate)\n"
    21 "\n"
    22 "Set filter coefficients to C-weighting.\n"
    23 "\n"
    24 "`samplerate` should be one of 8000, 11025, 16000, 22050, 24000, 32000,\n"
    25 "44100, 48000, 88200, 96000, or 192000. `order` of the filter should be 5.\n"
    26 "\n"
    27 "Parameters\n"
    28 "----------\n"
    29 "samplerate : int\n"
    30 "    Sampling-rate of the input signal, in Hz.\n"
    31 "";
    32 
    33 static char Py_filter_set_a_weighting_doc[] = ""
    34 "set_a_weighting(samplerate)\n"
    35 "\n"
    36 "Set filter coefficients to A-weighting.\n"
    37 "\n"
    38 "`samplerate` should be one of 8000, 11025, 16000, 22050, 24000, 32000,\n"
    39 "44100, 48000, 88200, 96000, or 192000. `order` of the filter should be 7.\n"
    40 "\n"
    41 "Parameters\n"
    42 "----------\n"
    43 "samplerate : int\n"
    44 "    Sampling-rate of the input signal.\n"
    45 "";
    46 
    47 static char Py_filter_set_biquad_doc[] = ""
    48 "set_biquad(b0, b1, b2, a1, a2)\n"
    49 "\n"
    50 "Set biquad coefficients. `order` of the filter should be 3.\n"
    51 "\n"
    52 "Parameters\n"
    53 "----------\n"
    54 "b0 : float\n"
    55 "    Forward filter coefficient.\n"
    56 "b1 : float\n"
    57 "    Forward filter coefficient.\n"
    58 "b2 : float\n"
    59 "    Forward filter coefficient.\n"
    60 "a1 : float\n"
    61 "    Feedback filter coefficient.\n"
    62 "a2 : float\n"
    63 "    Feedback filter coefficient.\n"
    64 "";
     13static char Py_filter_doc[] = "filter object";
    6514
    6615static PyObject *
     
    208157static PyMethodDef Py_filter_methods[] = {
    209158  {"set_c_weighting", (PyCFunction) Py_filter_set_c_weighting, METH_VARARGS,
    210       Py_filter_set_c_weighting_doc},
     159      "set filter coefficients to C-weighting"},
    211160  {"set_a_weighting", (PyCFunction) Py_filter_set_a_weighting, METH_VARARGS,
    212       Py_filter_set_a_weighting_doc},
     161      "set filter coefficients to A-weighting"},
    213162  {"set_biquad", (PyCFunction) Py_filter_set_biquad, METH_VARARGS,
    214       Py_filter_set_biquad_doc},
     163      "set b0, b1, b2, a1, a2 biquad coefficients"},
    215164  {NULL}
    216165};
  • python/ext/py-filterbank.c

    rc1ba75b radc6e02  
    11#include "aubio-types.h"
    22
    3 static char Py_filterbank_doc[] = ""
    4 "filterbank(n_filters=40, win_s=1024)\n"
    5 "\n"
    6 "Create a bank of spectral filters. Each instance is a callable\n"
    7 "that holds a matrix of coefficients.\n"
    8 "\n"
    9 "See also :meth:`set_mel_coeffs`, :meth:`set_mel_coeffs_htk`,\n"
    10 ":meth:`set_mel_coeffs_slaney`, :meth:`set_triangle_bands`, and\n"
    11 ":meth:`set_coeffs`.\n"
    12 "\n"
    13 "Parameters\n"
    14 "----------\n"
    15 "n_filters : int\n"
    16 "    Number of filters to create.\n"
    17 "win_s : int\n"
    18 "    Size of the input spectrum to process.\n"
    19 "\n"
    20 "Examples\n"
    21 "--------\n"
    22 ">>> f = aubio.filterbank(128, 1024)\n"
    23 ">>> f.set_mel_coeffs(44100, 0, 10000)\n"
    24 ">>> c = aubio.cvec(1024)\n"
    25 ">>> f(c).shape\n"
    26 "(128, )\n"
    27 "";
    28 
    29 static char Py_filterbank_set_triangle_bands_doc[] =""
    30 "set_triangle_bands(freqs, samplerate)\n"
    31 "\n"
    32 "Set triangular bands. The coefficients will be set to triangular\n"
    33 "overlapping windows using the boundaries specified by `freqs`.\n"
    34 "\n"
    35 "`freqs` should contain `n_filters + 2` frequencies in Hz, ordered\n"
    36 "by value, from smallest to largest. The first element should be greater\n"
    37 "or equal to zero; the last element should be smaller or equal to\n"
    38 "`samplerate / 2`.\n"
    39 "\n"
    40 "Parameters\n"
    41 "----------\n"
    42 "freqs: fvec\n"
    43 "    List of frequencies, in Hz.\n"
    44 "samplerate : float\n"
    45 "    Sampling-rate of the expected input.\n"
    46 "\n"
    47 "Example\n"
    48 "-------\n"
    49 ">>> fb = aubio.filterbank(n_filters=100, win_s=2048)\n"
    50 ">>> samplerate = 44100; freqs = np.linspace(0, 20200, 102)\n"
    51 ">>> fb.set_triangle_bands(aubio.fvec(freqs), samplerate)\n"
    52 "";
    53 
    54 static char Py_filterbank_set_mel_coeffs_slaney_doc[] = ""
    55 "set_mel_coeffs_slaney(samplerate)\n"
    56 "\n"
    57 "Set coefficients of filterbank to match Slaney's Auditory Toolbox.\n"
    58 "\n"
    59 "The filter coefficients will be set as in Malcolm Slaney's\n"
    60 "implementation. The filterbank should have been created with\n"
    61 "`n_filters = 40`.\n"
    62 "\n"
    63 "This is approximately equivalent to using :meth:`set_mel_coeffs` with\n"
    64 "`fmin = 400./3., fmax = 6853.84`.\n"
    65 "\n"
    66 "Parameters\n"
    67 "----------\n"
    68 "samplerate : float\n"
    69 "    Sampling-rate of the expected input.\n"
    70 "\n"
    71 "References\n"
    72 "----------\n"
    73 "\n"
    74 "Malcolm Slaney, `Auditory Toolbox Version 2, Technical Report #1998-010\n"
    75 "<https://engineering.purdue.edu/~malcolm/interval/1998-010/>`_\n"
    76 "";
    77 
    78 static char Py_filterbank_set_mel_coeffs_doc[] = ""
    79 "set_mel_coeffs(samplerate, fmin, fmax)\n"
    80 "\n"
    81 "Set coefficients of filterbank to linearly spaced mel scale.\n"
    82 "\n"
    83 "Parameters\n"
    84 "----------\n"
    85 "samplerate : float\n"
    86 "    Sampling-rate of the expected input.\n"
    87 "fmin : float\n"
    88 "    Lower frequency boundary of the first filter.\n"
    89 "fmax : float\n"
    90 "    Upper frequency boundary of the last filter.\n"
    91 "\n"
    92 "See also\n"
    93 "--------\n"
    94 "hztomel\n"
    95 "";
    96 
    97 static char Py_filterbank_set_mel_coeffs_htk_doc[] = ""
    98 "set_mel_coeffs_htk(samplerate, fmin, fmax)\n"
    99 "\n"
    100 "Set coefficients of the filters to be linearly spaced in the HTK mel scale.\n"
    101 "\n"
    102 "Parameters\n"
    103 "----------\n"
    104 "samplerate : float\n"
    105 "    Sampling-rate of the expected input.\n"
    106 "fmin : float\n"
    107 "    Lower frequency boundary of the first filter.\n"
    108 "fmax : float\n"
    109 "    Upper frequency boundary of the last filter.\n"
    110 "\n"
    111 "See also\n"
    112 "--------\n"
    113 "hztomel with `htk=True`\n"
    114 "";
    115 
    116 static char Py_filterbank_get_coeffs_doc[] = ""
    117 "get_coeffs()\n"
    118 "\n"
    119 "Get coefficients matrix of filterbank.\n"
    120 "\n"
    121 "Returns\n"
    122 "-------\n"
    123 "array_like\n"
    124 "    Array of shape (n_filters, win_s/2+1) containing the coefficients.\n"
    125 "";
    126 
    127 static char Py_filterbank_set_coeffs_doc[] = ""
    128 "set_coeffs(coeffs)\n"
    129 "\n"
    130 "Set coefficients of filterbank.\n"
    131 "\n"
    132 "Parameters\n"
    133 "----------\n"
    134 "coeffs : fmat\n"
    135 "    Array of shape (n_filters, win_s/2+1) containing the coefficients.\n"
    136 "";
    137 
    138 static char Py_filterbank_set_power_doc[] = ""
    139 "set_power(power)\n"
    140 "\n"
    141 "Set power applied to input spectrum of filterbank.\n"
    142 "\n"
    143 "Parameters\n"
    144 "----------\n"
    145 "power : float\n"
    146 "    Power to raise input spectrum to before computing the filters.\n"
    147 "";
    148 
    149 static char Py_filterbank_get_power_doc[] = ""
    150 "get_power()\n"
    151 "\n"
    152 "Get power applied to filterbank.\n"
    153 "\n"
    154 "Returns\n"
    155 "-------\n"
    156 "float\n"
    157 "    Power parameter.\n"
    158 "";
    159 
    160 static char Py_filterbank_set_norm_doc[] = ""
    161 "set_norm(norm)\n"
    162 "\n"
    163 "Set norm parameter. If set to `0`, the filters will not be normalized.\n"
    164 "If set to `1`, the filters will be normalized to one. Default to `1`.\n"
    165 "\n"
    166 "This function should be called *before* :meth:`set_triangle_bands`,\n"
    167 ":meth:`set_mel_coeffs`, :meth:`set_mel_coeffs_htk`, or\n"
    168 ":meth:`set_mel_coeffs_slaney`.\n"
    169 "\n"
    170 "Parameters\n"
    171 "----------\n"
    172 "norm : int\n"
    173 "   `0` to disable, `1` to enable\n"
    174 "";
    175 
    176 static char Py_filterbank_get_norm_doc[] = ""
    177 "get_norm()\n"
    178 "\n"
    179 "Get norm parameter of filterbank.\n"
    180 "\n"
    181 "Returns\n"
    182 "-------\n"
    183 "float\n"
    184 "    Norm parameter.\n"
    185 "";
     3static char Py_filterbank_doc[] = "filterbank object";
    1864
    1875typedef struct
     
    472290
    473291static PyObject *
    474 Py_filterbank_get_power (Py_filterbank * self, PyObject *unused)
    475 {
    476   smpl_t power = aubio_filterbank_get_power(self->o);
    477   return (PyObject *)PyFloat_FromDouble (power);
    478 }
    479 
    480 static PyObject *
    481292Py_filterbank_set_norm(Py_filterbank *self, PyObject *args)
    482293{
     
    501312}
    502313
    503 static PyObject *
    504 Py_filterbank_get_norm (Py_filterbank * self, PyObject *unused)
    505 {
    506   smpl_t norm = aubio_filterbank_get_norm(self->o);
    507   return (PyObject *)PyFloat_FromDouble (norm);
    508 }
    509 
    510314static PyMethodDef Py_filterbank_methods[] = {
    511315  {"set_triangle_bands", (PyCFunction) Py_filterbank_set_triangle_bands,
    512     METH_VARARGS, Py_filterbank_set_triangle_bands_doc},
     316    METH_VARARGS, "set coefficients of filterbanks"},
    513317  {"set_mel_coeffs_slaney", (PyCFunction) Py_filterbank_set_mel_coeffs_slaney,
    514     METH_VARARGS, Py_filterbank_set_mel_coeffs_slaney_doc},
     318    METH_VARARGS, "set coefficients of filterbank as in Auditory Toolbox"},
    515319  {"set_mel_coeffs", (PyCFunction) Py_filterbank_set_mel_coeffs,
    516     METH_VARARGS, Py_filterbank_set_mel_coeffs_doc},
     320    METH_VARARGS, "set coefficients of filterbank to linearly spaced mel scale"},
    517321  {"set_mel_coeffs_htk", (PyCFunction) Py_filterbank_set_mel_coeffs_htk,
    518     METH_VARARGS, Py_filterbank_set_mel_coeffs_htk_doc},
     322    METH_VARARGS, "set coefficients of filterbank to linearly spaced mel scale"},
    519323  {"get_coeffs", (PyCFunction) Py_filterbank_get_coeffs,
    520     METH_NOARGS, Py_filterbank_get_coeffs_doc},
     324    METH_NOARGS, "get coefficients of filterbank"},
    521325  {"set_coeffs", (PyCFunction) Py_filterbank_set_coeffs,
    522     METH_VARARGS, Py_filterbank_set_coeffs_doc},
     326    METH_VARARGS, "set coefficients of filterbank"},
    523327  {"set_power", (PyCFunction) Py_filterbank_set_power,
    524     METH_VARARGS, Py_filterbank_set_power_doc},
    525   {"get_power", (PyCFunction) Py_filterbank_get_power,
    526     METH_NOARGS, Py_filterbank_get_power_doc},
     328    METH_VARARGS, "set power applied to filterbank input spectrum"},
    527329  {"set_norm", (PyCFunction) Py_filterbank_set_norm,
    528     METH_VARARGS, Py_filterbank_set_norm_doc},
    529   {"get_norm", (PyCFunction) Py_filterbank_get_norm,
    530     METH_NOARGS, Py_filterbank_get_norm_doc},
     330    METH_VARARGS, "set norm applied to filterbank input spectrum"},
    531331  {NULL}
    532332};
  • python/lib/gen_code.py

    rc1ba75b radc6e02  
    232232
    233233    def gen_doc(self):
    234         sig = []
    235         for p in self.input_params:
    236             name = p['name']
    237             defval = aubiodefvalue[name].replace('"','\\\"')
    238             sig.append("{name}={defval}".format(defval=defval, name=name))
    239         out = """
    240 #ifndef PYAUBIO_{shortname}_doc
    241 #define PYAUBIO_{shortname}_doc "{shortname}({sig})"
    242 #endif /* PYAUBIO_{shortname}_doc */
    243 
    244 static char Py_{shortname}_doc[] = ""
    245 PYAUBIO_{shortname}_doc
    246 "";
     234        out = """
     235// TODO: add documentation
     236static char Py_{shortname}_doc[] = \"undefined\";
    247237"""
    248         return out.format(sig=', '.join(sig), **self.__dict__)
     238        return out.format(**self.__dict__)
    249239
    250240    def gen_new(self):
  • python/tests/test_mfcc.py

    rc1ba75b radc6e02  
    112112        buf_size, n_filters, n_coeffs, samplerate = 512, 20, 10, 16000
    113113        m = mfcc(buf_size, n_filters, n_coeffs, samplerate)
    114         m.set_scale(10.5)
    115         assert m.get_scale() == 10.5
     114        m.set_scale(10.)
    116115        m(cvec(buf_size))
    117116
     
    119118        buf_size, n_filters, n_coeffs, samplerate = 512, 20, 10, 16000
    120119        m = mfcc(buf_size, n_filters, n_coeffs, samplerate)
    121         m.set_power(2.5)
    122         assert m.get_power() == 2.5
     120        m.set_power(2.)
    123121        m(cvec(buf_size))
    124122
  • scripts/get_waf.sh

    rc1ba75b radc6e02  
    44#set -x
    55
    6 WAFVERSION=2.0.13
     6WAFVERSION=2.0.12
    77WAFTARBALL=waf-$WAFVERSION.tar.bz2
    88WAFURL=https://waf.io/$WAFTARBALL
  • src/pitch/pitchspecacf.c

    rc1ba75b radc6e02  
    9393  del_fvec (p->sqrmag);
    9494  del_fvec (p->fftout);
    95   del_fvec (p->acf);
    9695  AUBIO_FREE (p);
    9796}
  • src/spectral/awhitening.c

    rc1ba75b radc6e02  
    4444{
    4545  uint_t i = 0;
    46   uint_t length = MIN(fftgrain->length, o->peak_values->length);
    47   for (i = 0; i < length; i++) {
     46  for (i = 0; i < o->peak_values->length; i++) {
    4847    smpl_t tmp = MAX(o->r_decay * o->peak_values->data[i], o->floor);
    4948    o->peak_values->data[i] = MAX(fftgrain->norm[i], tmp);
  • src/spectral/filterbank.c

    rc1ba75b radc6e02  
    131131aubio_filterbank_get_power (aubio_filterbank_t *f)
    132132{
    133   return f->power;
     133  return f->norm;
    134134}
  • src/spectral/mfcc.c

    rc1ba75b radc6e02  
    144144}
    145145
    146 smpl_t aubio_mfcc_get_power (aubio_mfcc_t *mf)
     146uint_t aubio_mfcc_get_power (aubio_mfcc_t *mf)
    147147{
    148148  return aubio_filterbank_get_power(mf->fb);
     
    155155}
    156156
    157 smpl_t aubio_mfcc_get_scale (aubio_mfcc_t *mf)
     157uint_t aubio_mfcc_get_scale (aubio_mfcc_t *mf)
    158158{
    159159  return mf->scale;
  • src/spectral/mfcc.h

    rc1ba75b radc6e02  
    9393
    9494 */
    95 smpl_t aubio_mfcc_get_power (aubio_mfcc_t *mf);
     95uint_t aubio_mfcc_get_power (aubio_mfcc_t *mf);
    9696
    9797/** set scaling parameter
     
    112112
    113113 */
    114 smpl_t aubio_mfcc_get_scale (aubio_mfcc_t *mf);
     114uint_t aubio_mfcc_get_scale (aubio_mfcc_t *mf);
    115115
    116116/** Mel filterbank initialization
  • src/utils/hist.c

    rc1ba75b radc6e02  
    4545  uint_t i;
    4646  if ((sint_t)nelems <= 0) {
    47     AUBIO_FREE(s);
    4847    return NULL;
    4948  }
  • tests/src/spectral/test-awhitening.c

    rc1ba75b radc6e02  
    4242
    4343  aubio_pvoc_t *pv = new_aubio_pvoc(win_size, hop_size);
    44   if (!pv) { err = 1; goto beach_pvoc; }
    4544
    4645  aubio_spectral_whitening_t *awhitening =
    4746    new_aubio_spectral_whitening (win_size, hop_size, samplerate);
    48   if (!awhitening) { err = 1; goto beach_awhitening; }
    4947
    5048  aubio_spectral_whitening_set_relax_time(awhitening, 20.);
     
    7472      source_path, sink_path);
    7573
    76   del_aubio_spectral_whitening(awhitening);
    77 beach_awhitening:
    78   del_aubio_pvoc(pv);
    79 beach_pvoc:
    8074  del_aubio_sink(o);
    8175beach_sink:
     
    8377beach_source:
    8478  del_fvec(vec);
    85   del_fvec(out);
    86   del_fvec(scale);
    87   del_cvec(fftgrain);
    8879beach_fvec:
    8980  return err;
  • tests/src/spectral/test-mfcc.c

    rc1ba75b radc6e02  
    11#include <aubio.h>
    2 #include "utils_tests.h"
    32
    4 int test_wrong_params(void);
    5 
    6 int main (int argc, char** argv)
    7 {
    8   sint_t err = 0;
    9 
    10   if (argc < 2) {
    11     err = 2;
    12     PRINT_WRN("no arguments, running tests\n");
    13     err = test_wrong_params();
    14     PRINT_MSG("usage: %s <input_path> [samplerate] [hop_size]\n", argv[0]);
    15     return err;
    16   }
    17 
    18   uint_t win_s; // fft size
    19   uint_t hop_s = 256; // block size
    20   uint_t samplerate = 0; // samplerate
    21   uint_t n_filters = 40; // number of filters
    22   uint_t n_coeffs = 13; // number of coefficients
    23   uint_t read = 0;
    24 
    25   char_t *source_path = argv[1];
    26 
    27   if ( argc >= 3 ) samplerate = atoi(argv[2]);
    28   if ( argc >= 4 ) hop_s = atoi(argv[3]);
    29 
    30   win_s = 2 * hop_s;
    31 
    32   aubio_source_t *source = 0;
    33   aubio_pvoc_t *pv = 0;
    34   aubio_mfcc_t *mfcc = 0;
    35 
    36   fvec_t *in = new_fvec (win_s); // input buffer
    37   cvec_t *fftgrain = new_cvec (win_s); // input buffer
    38   fvec_t *out = new_fvec (n_coeffs); // output coefficients
    39 
    40   if (!in || !fftgrain || !out) { err = 1; goto failure; }
    41 
    42   // source
    43   source = new_aubio_source(source_path, samplerate, hop_s);
    44   if (!source) { err = 1; goto failure; }
    45   if (samplerate == 0) samplerate = aubio_source_get_samplerate(source);
    46 
    47   // phase vocoder
    48   pv = new_aubio_pvoc(win_s, hop_s);
    49   if (!pv) { err = 1; goto failure; }
    50 
    51   // mfcc object
    52   mfcc = new_aubio_mfcc (win_s, n_filters, n_coeffs, samplerate);
    53   if (!mfcc) { err = 1; goto failure; }
    54 
    55   // processing loop
    56   do {
    57     aubio_source_do(source, in, &read);
    58     aubio_pvoc_do(pv, in, fftgrain);
    59     aubio_mfcc_do(mfcc, fftgrain, out);
    60     fvec_print(out);
    61   } while (read == hop_s);
    62 
    63 failure:
    64 
    65   if (mfcc)
    66     del_aubio_mfcc(mfcc);
    67   if (pv)
    68     del_aubio_pvoc(pv);
    69   if (source)
    70     del_aubio_source(source);
    71   if (in)
    72     del_fvec(in);
    73   if (fftgrain)
    74     del_cvec(fftgrain);
    75   if (out)
    76     del_fvec(out);
    77   aubio_cleanup();
    78   return err;
    79 }
    80 
    81 int test_wrong_params()
     3int main (void)
    824{
    835  uint_t win_s = 512; // fft size
     
    857  uint_t n_coeffs = 13; // number of coefficients
    868  smpl_t samplerate = 16000.; // samplerate
     9  cvec_t *in = new_cvec (win_s); // input buffer
     10  fvec_t *out = new_fvec (n_coeffs); // output coefficients
    8711
    8812  if (new_aubio_mfcc(    0, n_filters, n_coeffs, samplerate)) return 1;
     
    9115  if (new_aubio_mfcc(win_s, n_filters, n_coeffs,          0)) return 1;
    9216
    93   return run_on_default_source(main);
     17  // create mfcc object
     18  aubio_mfcc_t *o = new_aubio_mfcc (win_s, n_filters, n_coeffs, samplerate);
     19
     20  cvec_norm_set_all (in, 1.);
     21  aubio_mfcc_do (o, in, out);
     22  fvec_print (out);
     23
     24  cvec_norm_set_all (in, .5);
     25  aubio_mfcc_do (o, in, out);
     26  fvec_print (out);
     27
     28  // clean up
     29  del_aubio_mfcc (o);
     30  del_cvec (in);
     31  del_fvec (out);
     32  aubio_cleanup ();
     33
     34  return 0;
    9435}
  • tests/src/test-mathutils.c

    rc1ba75b radc6e02  
    101101  fvec_set_window(window, "rectangle");
    102102  fvec_print(window);
    103   del_fvec(window);
    104103
    105104  window_size /= 2.;
  • wscript

    rc1ba75b radc6e02  
    547547    if bld.env['DOXYGEN']:
    548548        bld.env.VERSION = VERSION
    549         rule = '( cat ${SRC[0]} && echo PROJECT_NUMBER=${VERSION}'
    550         rule += ' && echo OUTPUT_DIRECTORY=%s && echo HTML_OUTPUT=%s )'
     549        rule = '( cat ${SRC} && echo PROJECT_NUMBER=${VERSION}; )'
    551550        rule += ' | doxygen - > /dev/null'
    552         rule %= (os.path.abspath(out), 'api')
    553551        bld( name = 'doxygen', rule = rule,
    554                 source = ['doc/web.cfg']
    555                     + bld.path.find_dir('src').ant_glob('**/*.h'),
    556                 target = bld.path.find_or_declare('api/index.html'),
    557                 cwd = bld.path.find_dir('doc'))
    558         bld.install_files('${DATAROOTDIR}/doc/libaubio-doc/api',
    559                 bld.path.find_or_declare('api').ant_glob('**/*'),
    560                 cwd=bld.path.find_or_declare('api'),
    561                 relative_trick=True)
     552                source = 'doc/web.cfg',
     553                target = '../doc/web/html/index.html',
     554                cwd = 'doc')
     555        bld.install_files( '${DATAROOTDIR}' + '/doc/libaubio-doc',
     556                bld.path.ant_glob('doc/web/html/**'),
     557                cwd = bld.path.find_dir ('doc/web'),
     558                relative_trick = True)
    562559
    563560def sphinx(bld):
    564     # build documentation from source files using sphinx-build
    565     try:
    566         import aubio
    567         has_aubio = True
    568     except ImportError:
    569         from waflib import Logs
    570         Logs.pprint('YELLOW', "Sphinx manual: install aubio first")
    571         has_aubio = False
    572     if bld.env['SPHINX'] and has_aubio:
     561    # build documentation from source files using sphinx-build note: build in
     562    # ../doc/_build/html, otherwise waf wont install unsigned files
     563    if bld.env['SPHINX']:
    573564        bld.env.VERSION = VERSION
    574         rule = '${SPHINX} -b html -D release=${VERSION}' \
    575                 ' -D version=${VERSION} -W -a -q' \
    576                 ' -d %s ' % os.path.join(os.path.abspath(out), 'doctrees')
    577         rule += ' . %s' % os.path.join(os.path.abspath(out), 'manual')
    578         bld( name = 'sphinx', rule = rule,
    579                 cwd = bld.path.find_dir('doc'),
    580                 source = bld.path.find_dir('doc').ant_glob('*.rst'),
    581                 target = bld.path.find_or_declare('manual/index.html'))
    582         bld.install_files('${DATAROOTDIR}/doc/libaubio-doc/manual',
    583                 bld.path.find_or_declare('manual').ant_glob('**/*'),
    584                 cwd=bld.path.find_or_declare('manual'),
    585                 relative_trick=True)
     565        bld( name = 'sphinx',
     566                rule = '${SPHINX} -b html -D release=${VERSION}' \
     567                        ' -D version=${VERSION} -a -q' \
     568                        ' `dirname ${SRC}` `dirname ${TGT}`',
     569                source = 'doc/conf.py',
     570                target = '../doc/_build/html/index.html')
     571        bld.install_files( '${DATAROOTDIR}' + '/doc/libaubio-doc/sphinx',
     572                bld.path.ant_glob('doc/_build/html/**'),
     573                cwd = bld.path.find_dir('doc/_build/html'),
     574                relative_trick = True)
    586575
    587576# register the previous rules as build rules
Note: See TracChangeset for help on using the changeset viewer.