/* delete object */ uint_t del_aubio_audio_unit(aubio_audio_unit_t *o) { int err = 0; err = aubio_audio_unit_stop(o); if (o->au_ios_inbuf) free(o->au_ios_inbuf); o->au_ios_inbuf = NULL; if (o->au_ios_outbuf) free(o->au_ios_outbuf); o->au_ios_outbuf = NULL; del_fmat (o->input_frames); del_fmat (o->output_frames); o->audio_unit = NULL; return (int)err; }
int main(){ uint_t length = 1024; /* length */ uint_t height = 1024; /* height */ fmat_t * mat = new_fmat (length, height); /* input buffer */ fmat_print(mat); del_fmat(mat); return 0; }
void del_aubio_sampler( aubio_sampler_t * o ) { if (o->source) { del_aubio_source(o->source); } del_fvec(o->source_output); del_fmat(o->source_output_multi); AUBIO_FREE(o); }
void del_aubio_mfcc (aubio_mfcc_t * mf) { /* delete filterbank */ del_aubio_filterbank (mf->fb); /* delete buffers */ del_fvec (mf->in_dct); del_fmat (mf->dct_coeffs); /* delete mfcc object */ AUBIO_FREE (mf); }
int main (void) { uint_t height = 3, length = 9, i, j; // create fmat_t object fmat_t * mat = new_fmat (height, length); for ( i = 0; i < mat->height; i++ ) { for ( j = 0; j < mat->length; j++ ) { // all elements are already initialized to 0. assert(mat->data[i][j] == 0); // setting element of row i, column j mat->data[i][j] = i * 1. + j *.1; } } fvec_t channel_onstack; fvec_t *channel = &channel_onstack; fmat_get_channel(mat, 1, channel); fvec_print (channel); // print out matrix fmat_print(mat); // destroy it del_fmat(mat); return 0; }
void del_aubio_filterbank (aubio_filterbank_t * fb) { del_fmat (fb->filters); AUBIO_FREE (fb); }