source: swig/aubio.i @ d836c21

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since d836c21 was 7dec719, checked in by Paul Brossier <piem@piem.org>, 15 years ago

swig/aubio.i: switch to mono

  • Property mode set to 100644
File size: 5.7 KB
RevLine 
[96fb8ad]1%module aubiowrapper
2
3%{
4#include "aubio.h"
[740f06b]5%}
[96fb8ad]6
7/* type aliases */
8typedef unsigned int uint_t;
9typedef int sint_t;
10typedef float smpl_t;
[61139c6]11typedef char char_t;
[96fb8ad]12
13/* fvec */
[7dec719]14fvec_t * new_fvec(uint_t length);
[e5f49af]15void del_fvec(fvec_t *s);
[7dec719]16smpl_t fvec_read_sample(fvec_t *s, uint_t position);
17void fvec_write_sample(fvec_t *s, smpl_t data, uint_t position);
18smpl_t * fvec_get_data(fvec_t *s);
[96fb8ad]19
20/* cvec */
[7dec719]21cvec_t * new_cvec(uint_t length);
[e5f49af]22void del_cvec(cvec_t *s);
[7dec719]23void cvec_write_norm(cvec_t *s, smpl_t data, uint_t position);
24void cvec_write_phas(cvec_t *s, smpl_t data, uint_t position);
25smpl_t cvec_read_norm(cvec_t *s, uint_t position);
26smpl_t cvec_read_phas(cvec_t *s, uint_t position);
27smpl_t * cvec_get_norm(cvec_t *s);
28smpl_t * cvec_get_phas(cvec_t *s);
[96fb8ad]29
30
31/* fft */
[7dec719]32aubio_fft_t * new_aubio_fft(uint_t size);
[e5f49af]33void del_aubio_fft(aubio_fft_t * s);
34void aubio_fft_do (aubio_fft_t *s, fvec_t * input, cvec_t * spectrum);
35void aubio_fft_rdo (aubio_fft_t *s, cvec_t * spectrum, fvec_t * output);
36void aubio_fft_do_complex (aubio_fft_t *s, fvec_t * input, fvec_t * compspec);
37void aubio_fft_rdo_complex (aubio_fft_t *s, fvec_t * compspec, fvec_t * output);
38void aubio_fft_get_spectrum(fvec_t * compspec, cvec_t * spectrum);
39void aubio_fft_get_realimag(cvec_t * spectrum, fvec_t * compspec);
40void aubio_fft_get_phas(fvec_t * compspec, cvec_t * spectrum);
41void aubio_fft_get_imag(cvec_t * spectrum, fvec_t * compspec);
42void aubio_fft_get_norm(fvec_t * compspec, cvec_t * spectrum);
43void aubio_fft_get_real(cvec_t * spectrum, fvec_t * compspec);
[ec10780]44
[96fb8ad]45/* filter */
[7dec719]46aubio_filter_t * new_aubio_filter(uint_t order);
[e5f49af]47void aubio_filter_do(aubio_filter_t * b, fvec_t * in);
48void aubio_filter_do_outplace(aubio_filter_t * b, fvec_t * in, fvec_t * out);
49void aubio_filter_do_filtfilt(aubio_filter_t * b, fvec_t * in, fvec_t * tmp);
50void del_aubio_filter(aubio_filter_t * b);
[4123f16]51
[68607fd]52/* a_weighting */
[7dec719]53aubio_filter_t * new_aubio_filter_a_weighting (uint_t samplerate);
[59c046d]54uint_t aubio_filter_set_a_weighting (aubio_filter_t * b, uint_t samplerate);
[4123f16]55
[68607fd]56/* c_weighting */
[7dec719]57aubio_filter_t * new_aubio_filter_c_weighting (uint_t samplerate);
[59c046d]58uint_t aubio_filter_set_c_weighting (aubio_filter_t * b, uint_t samplerate);
[96fb8ad]59
60/* biquad */
[7dec719]61aubio_filter_t * new_aubio_filter_biquad(lsmp_t b1, lsmp_t b2, lsmp_t b3, lsmp_t a2, lsmp_t a3);
[b01bd4a]62uint_t aubio_filter_set_biquad (aubio_filter_t * b, lsmp_t b1, lsmp_t b2, lsmp_t b3, lsmp_t a2, lsmp_t a3);
[96fb8ad]63
64/* mathutils */
[74516f7]65fvec_t * new_aubio_window(char * wintype, uint_t size);
[28d8c4a]66smpl_t aubio_unwrap2pi (smpl_t phase);
67smpl_t aubio_bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize);
[79c2e52]68smpl_t aubio_miditobin(smpl_t midi, smpl_t samplerate, smpl_t fftsize);
[28d8c4a]69smpl_t aubio_bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize);
[79c2e52]70smpl_t aubio_freqtobin(smpl_t freq, smpl_t samplerate, smpl_t fftsize);
[28d8c4a]71smpl_t aubio_freqtomidi(smpl_t freq);
[79c2e52]72smpl_t aubio_miditofreq(smpl_t midi);
[96fb8ad]73uint_t aubio_silence_detection(fvec_t * ibuf, smpl_t threshold);
74smpl_t aubio_level_detection(fvec_t * ibuf, smpl_t threshold);
[5507e9d]75smpl_t aubio_zero_crossing_rate(fvec_t * input);
[bc4ba75]76
77/* mfcc */
[adcf405]78aubio_mfcc_t * new_aubio_mfcc (uint_t win_s, uint_t samplerate, uint_t n_filters, uint_t n_coefs);
[bc4ba75]79void del_aubio_mfcc(aubio_mfcc_t *mf);
80void aubio_mfcc_do(aubio_mfcc_t *mf, cvec_t *in, fvec_t *out);
81
[96fb8ad]82/* resampling */
[740f06b]83#if HAVE_SAMPLERATE
[e5f49af]84aubio_resampler_t * new_aubio_resampler(float ratio, uint_t type);
85void aubio_resampler_do (aubio_resampler_t *s, fvec_t * input,  fvec_t * output);
86void del_aubio_resampler(aubio_resampler_t *s);
[740f06b]87#endif /* HAVE_SAMPLERATE */
[96fb8ad]88
89/* pvoc */
[7dec719]90aubio_pvoc_t * new_aubio_pvoc (uint_t win_s, uint_t hop_s);
[96fb8ad]91void del_aubio_pvoc(aubio_pvoc_t *pv);
92void aubio_pvoc_do(aubio_pvoc_t *pv, fvec_t *in, cvec_t * fftgrain);
93void aubio_pvoc_rdo(aubio_pvoc_t *pv, cvec_t * fftgrain, fvec_t *out);
94
95/* pitch detection */
[ca1abdd]96aubio_pitch_t *new_aubio_pitch (char *pitch_mode,
[7dec719]97    uint_t bufsize, uint_t hopsize, uint_t samplerate);
[ca1abdd]98void aubio_pitch_do (aubio_pitch_t * p, fvec_t * ibuf, fvec_t * obuf);
99uint_t aubio_pitch_set_tolerance(aubio_pitch_t *p, smpl_t thres);
100uint_t aubio_pitch_set_unit(aubio_pitch_t *p, char * pitch_unit);
101void del_aubio_pitch(aubio_pitch_t * p);
[8e8bc50]102
[740f06b]103/* tempo */
104aubio_tempo_t * new_aubio_tempo (char_t * mode,
[7dec719]105    uint_t buf_size, uint_t hop_size, uint_t samplerate);
[740f06b]106void aubio_tempo_do (aubio_tempo_t *o, fvec_t * input, fvec_t * tempo);
107uint_t aubio_tempo_set_silence(aubio_tempo_t * o, smpl_t silence);
108uint_t aubio_tempo_set_threshold(aubio_tempo_t * o, smpl_t threshold);
109smpl_t aubio_tempo_get_bpm(aubio_tempo_t * bt);
110smpl_t aubio_tempo_get_confidence(aubio_tempo_t * bt);
111void del_aubio_tempo(aubio_tempo_t * o);
112
[61139c6]113/* specdesc */
114void aubio_specdesc_do (aubio_specdesc_t * o, cvec_t * fftgrain,
115  fvec_t * desc);
[7dec719]116aubio_specdesc_t *new_aubio_specdesc (char_t * method, uint_t buf_size);
[61139c6]117void del_aubio_specdesc (aubio_specdesc_t * o);
118
119/* peak picker */
[7dec719]120aubio_peakpicker_t * new_aubio_peakpicker();
[61139c6]121void aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * in, fvec_t * out);
122fvec_t * aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t * p);
123void del_aubio_peakpicker(aubio_peakpicker_t * p);
124uint_t aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold);
125
[740f06b]126/* sndfile */
127%{
[61139c6]128#include "config.h"
[740f06b]129#if HAVE_SNDFILE
130#include "sndfileio.h"
131%}
[e5f49af]132aubio_sndfile_t * new_aubio_sndfile_ro (const char * inputfile);
133aubio_sndfile_t * new_aubio_sndfile_wo(aubio_sndfile_t * existingfile, const char * outputname);
134void aubio_sndfile_info(aubio_sndfile_t * file);
[7dec719]135int aubio_sndfile_write(aubio_sndfile_t * file, int frames, fvec_t ** write);
136int aubio_sndfile_read(aubio_sndfile_t * file, int frames, fvec_t ** read);
[e5f49af]137int del_aubio_sndfile(aubio_sndfile_t * file);
138uint_t aubio_sndfile_channels(aubio_sndfile_t * file);
139uint_t aubio_sndfile_samplerate(aubio_sndfile_t * file);
[740f06b]140%{
141#endif /* HAVE_SNDFILE */
142%}
Note: See TracBrowser for help on using the repository browser.