本文整理汇总了C++中AUBIO_FREE函数的典型用法代码示例。如果您正苦于以下问题:C++ AUBIO_FREE函数的具体用法?C++ AUBIO_FREE怎么用?C++ AUBIO_FREE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AUBIO_FREE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: del_aubio_resampler
void
del_aubio_resampler (aubio_resampler_t * s)
{
if (s->stat) src_delete (s->stat);
AUBIO_FREE (s->proc);
AUBIO_FREE (s);
}
示例2: del_aubio_sink_sndfile
void del_aubio_sink_sndfile(aubio_sink_sndfile_t * s){
if (!s) return;
if (s->path) AUBIO_FREE(s->path);
aubio_sink_sndfile_close(s);
AUBIO_FREE(s->scratch_data);
AUBIO_FREE(s);
}
示例3: del_fmat
void del_fmat (fmat_t *s) {
uint_t i;
for (i=0; i<s->height; i++) {
AUBIO_FREE(s->data[i]);
}
AUBIO_FREE(s->data);
AUBIO_FREE(s);
}
示例4: aubio_jack_free
static uint_t aubio_jack_free(aubio_jack_t * jack_setup) {
AUBIO_FREE(jack_setup->oports);
AUBIO_FREE(jack_setup->iports);
AUBIO_FREE(jack_setup->ibufs );
AUBIO_FREE(jack_setup->obufs );
AUBIO_FREE(jack_setup);
return AUBIO_OK;
}
示例5: del_aubio_pvoc
void del_aubio_pvoc(aubio_pvoc_t *pv) {
del_fvec(pv->data);
del_fvec(pv->synth);
del_fvec(pv->dataold);
del_fvec(pv->synthold);
del_aubio_mfft(pv->fft);
AUBIO_FREE(pv->w);
AUBIO_FREE(pv);
}
示例6: del_aubio_track
/** del_aubio_track */
int del_aubio_track(aubio_track_t* track)
{
if (track->name != NULL) {
AUBIO_FREE(track->name);
}
if (track->first != NULL) {
del_aubio_midi_event(track->first);
}
AUBIO_FREE(track);
return AUBIO_OK;
}
示例7: del_aubio_fft
void del_aubio_fft(aubio_fft_t * s) {
/* destroy data */
del_fvec(s->compspec);
#ifdef HAVE_FFTW3
fftw_destroy_plan(s->pfw);
fftw_destroy_plan(s->pbw);
fftw_free(s->specdata);
#else /* HAVE_FFTW3 */
AUBIO_FREE(s->w);
AUBIO_FREE(s->ip);
#endif /* HAVE_FFTW3 */
AUBIO_FREE(s->out);
AUBIO_FREE(s->in);
AUBIO_FREE(s);
}
示例8: del_aubio_list1
void
del_aubio_list1(aubio_list_t *list)
{
if (list) {
AUBIO_FREE(list);
}
}
示例9: AUBIO_NEW
aubio_wavetable_t *new_aubio_wavetable(uint_t samplerate, uint_t blocksize)
{
uint_t i = 0;
aubio_wavetable_t *s = AUBIO_NEW(aubio_wavetable_t);
if ((sint_t)samplerate <= 0) {
AUBIO_ERR("Can not create wavetable with samplerate %d\n", samplerate);
goto beach;
}
s->samplerate = samplerate;
s->blocksize = blocksize;
s->wavetable_length = WAVETABLE_LEN;
s->wavetable = new_fvec(s->wavetable_length + 3);
for (i = 0; i < s->wavetable_length; i++) {
s->wavetable->data[i] = SIN(TWO_PI * i / (smpl_t) s->wavetable_length );
}
s->wavetable->data[s->wavetable_length] = s->wavetable->data[0];
s->wavetable->data[s->wavetable_length + 1] = s->wavetable->data[1];
s->wavetable->data[s->wavetable_length + 2] = s->wavetable->data[2];
s->playing = 0;
s->last_pos = 0.;
s->freq = new_aubio_parameter( 0., s->samplerate / 2., 10 );
s->amp = new_aubio_parameter( 0., 1., 100 );
return s;
beach:
AUBIO_FREE(s);
return NULL;
}
示例10: new_aubio_filterbank
aubio_filterbank_t *
new_aubio_filterbank (uint_t n_filters, uint_t win_s)
{
/* allocate space for filterbank object */
aubio_filterbank_t *fb = AUBIO_NEW (aubio_filterbank_t);
if ((sint_t)n_filters <= 0) {
AUBIO_ERR("filterbank: n_filters should be > 0, got %d\n", n_filters);
goto fail;
}
if ((sint_t)win_s <= 0) {
AUBIO_ERR("filterbank: win_s should be > 0, got %d\n", win_s);
goto fail;
}
fb->win_s = win_s;
fb->n_filters = n_filters;
/* allocate filter tables, a matrix of length win_s and of height n_filters */
fb->filters = new_fmat (n_filters, win_s / 2 + 1);
fb->norm = 1;
fb->power = 1;
return fb;
fail:
AUBIO_FREE (fb);
return NULL;
}
示例11: del_aubio_source_avcodec
void del_aubio_source_avcodec(aubio_source_avcodec_t * s){
if (!s) return;
if (s->output != NULL) {
av_free(s->output);
}
if (s->avr != NULL) {
avresample_close( s->avr );
av_free ( s->avr );
}
s->avr = NULL;
if (s->avFrame != NULL) {
avcodec_free_frame( &(s->avFrame) );
}
s->avFrame = NULL;
if (s->avCodecCtx != NULL) {
avcodec_close ( s->avCodecCtx );
}
s->avCodecCtx = NULL;
if (s->avFormatCtx != NULL) {
avformat_close_input ( &(s->avFormatCtx) );
}
s->avFrame = NULL;
s->avFormatCtx = NULL;
AUBIO_FREE(s);
}
示例12: del_aubio_wavetable
void del_aubio_wavetable( aubio_wavetable_t * s )
{
del_aubio_parameter(s->freq);
del_aubio_parameter(s->amp);
del_fvec(s->wavetable);
AUBIO_FREE(s);
}
示例13: new_aubio_sink_sndfile
aubio_sink_sndfile_t * new_aubio_sink_sndfile(const char_t * path, uint_t samplerate) {
aubio_sink_sndfile_t * s = AUBIO_NEW(aubio_sink_sndfile_t);
s->max_size = MAX_SIZE;
if (path == NULL) {
AUBIO_ERR("sink_sndfile: Aborted opening null path\n");
return NULL;
}
if (s->path) AUBIO_FREE(s->path);
s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
s->samplerate = 0;
s->channels = 0;
// negative samplerate given, abort
if ((sint_t)samplerate < 0) goto beach;
// zero samplerate given. do not open yet
if ((sint_t)samplerate == 0) return s;
s->samplerate = samplerate;
s->channels = 1;
if (aubio_sink_sndfile_open(s) != AUBIO_OK) {;
goto beach;
}
return s;
beach:
del_aubio_sink_sndfile(s);
return NULL;
}
示例14: del_aubio_pitchmcomb
void
del_aubio_pitchmcomb (aubio_pitchmcomb_t * p)
{
uint_t i;
del_fvec (p->newmag);
del_fvec (p->scratch);
del_fvec (p->theta);
del_fvec (p->scratch2);
AUBIO_FREE (p->peaks);
for (i = 0; i < p->ncand; i++) {
AUBIO_FREE (p->candidates[i]->ecomb);
AUBIO_FREE (p->candidates[i]);
}
AUBIO_FREE (p->candidates);
AUBIO_FREE (p);
}
示例15: del_aubio_alsa_seq_driver
/** del_aubio_alsa_seq_driver */
int del_aubio_alsa_seq_driver(aubio_midi_driver_t* p)
{
aubio_alsa_seq_driver_t* dev;
dev = (aubio_alsa_seq_driver_t*) p;
if (dev == NULL) {
return AUBIO_OK;
}
dev->status = AUBIO_MIDI_DONE;
/* cancel the thread and wait for it before cleaning up */
if (dev->thread) {
if (pthread_cancel(dev->thread)) {
AUBIO_ERR( "Failed to cancel the midi thread");
return AUBIO_FAIL;
}
if (pthread_join(dev->thread, NULL)) {
AUBIO_ERR( "Failed to join the midi thread");
return AUBIO_FAIL;
}
}
if (dev->seq_port >= 0) {
snd_seq_delete_simple_port (dev->seq_handle, dev->seq_port);
}
if (dev->seq_handle) {
snd_seq_drain_output(dev->seq_handle);
snd_seq_close(dev->seq_handle);
}
AUBIO_FREE(dev);
return AUBIO_OK;
}