1pub const HAVE_AUBIO_DOUBLE: u32 = 0;
4pub const AUBIO_SMPL_FMT: &'static [u8; 3usize] = b"%f\0";
5pub const AUBIO_LSMP_FMT: &'static [u8; 4usize] = b"%lf\0";
6pub type smpl_t = f32;
7pub type lsmp_t = f64;
8#[doc = " unsigned integer"]
9pub type uint_t = ::std::os::raw::c_uint;
10#[doc = " signed integer"]
11pub type sint_t = ::std::os::raw::c_int;
12#[doc = " character"]
13pub type char_t = ::std::os::raw::c_char;
14#[doc = " Buffer for real data"]
15#[doc = ""]
16#[doc = "Vector of real-valued data"]
17#[doc = ""]
18#[doc = "::fvec_t is is the structure used to store vector of real-valued data, ::smpl_t ."]
19#[doc = ""]
20#[doc = "\\code"]
21#[doc = ""]
22#[doc = "uint_t buffer_size = 1024;"]
23#[doc = ""]
24#[doc = "fvec_t * input = new_fvec (buffer_size);"]
25#[doc = ""]
26#[doc = "input->data[23] = 2.;"]
27#[doc = ""]
28#[doc = "mean = fvec_mean(a_vector);"]
29#[doc = ""]
30#[doc = "del_fvec(a_vector);"]
31#[doc = ""]
32#[doc = "\\endcode"]
33#[doc = ""]
34#[doc = "See `examples/` and `tests/src` directories for more examples."]
35#[doc = ""]
36#[repr(C)]
37#[derive(Debug, Copy, Clone)]
38pub struct fvec_t {
39 #[doc = "< length of buffer"]
40 pub length: uint_t,
41 #[doc = "< data vector of length ::fvec_t.length"]
42 pub data: *mut smpl_t,
43}
44#[test]
45fn bindgen_test_layout_fvec_t() {
46 assert_eq!(
47 ::std::mem::size_of::<fvec_t>(),
48 16usize,
49 concat!("Size of: ", stringify!(fvec_t))
50 );
51 assert_eq!(
52 ::std::mem::align_of::<fvec_t>(),
53 8usize,
54 concat!("Alignment of ", stringify!(fvec_t))
55 );
56 assert_eq!(
57 unsafe { &(*(::std::ptr::null::<fvec_t>())).length as *const _ as usize },
58 0usize,
59 concat!(
60 "Offset of field: ",
61 stringify!(fvec_t),
62 "::",
63 stringify!(length)
64 )
65 );
66 assert_eq!(
67 unsafe { &(*(::std::ptr::null::<fvec_t>())).data as *const _ as usize },
68 8usize,
69 concat!(
70 "Offset of field: ",
71 stringify!(fvec_t),
72 "::",
73 stringify!(data)
74 )
75 );
76}
77extern "C" {
78 #[doc = " fvec_t buffer creation function"]
79 #[doc = ""]
80 #[doc = "\\param length the length of the buffer to create"]
81 pub fn new_fvec(length: uint_t) -> *mut fvec_t;
82}
83extern "C" {
84 #[doc = " fvec_t buffer deletion function"]
85 #[doc = ""]
86 #[doc = "\\param s buffer to delete as returned by new_fvec()"]
87 pub fn del_fvec(s: *mut fvec_t);
88}
89extern "C" {
90 #[doc = " read sample value in a buffer"]
91 #[doc = ""]
92 #[doc = "\\param s vector to read from"]
93 #[doc = "\\param position sample position to read from"]
94 pub fn fvec_get_sample(s: *const fvec_t, position: uint_t) -> smpl_t;
95}
96extern "C" {
97 #[doc = " write sample value in a buffer"]
98 #[doc = ""]
99 #[doc = "\\param s vector to write to"]
100 #[doc = "\\param data value to write in s->data[position]"]
101 #[doc = "\\param position sample position to write to"]
102 pub fn fvec_set_sample(s: *mut fvec_t, data: smpl_t, position: uint_t);
103}
104extern "C" {
105 #[doc = " read data from a buffer"]
106 #[doc = ""]
107 #[doc = "\\param s vector to read from"]
108 pub fn fvec_get_data(s: *const fvec_t) -> *mut smpl_t;
109}
110extern "C" {
111 #[doc = " print out fvec data"]
112 #[doc = ""]
113 #[doc = "\\param s vector to print out"]
114 pub fn fvec_print(s: *const fvec_t);
115}
116extern "C" {
117 #[doc = " set all elements to a given value"]
118 #[doc = ""]
119 #[doc = "\\param s vector to modify"]
120 #[doc = "\\param val value to set elements to"]
121 pub fn fvec_set_all(s: *mut fvec_t, val: smpl_t);
122}
123extern "C" {
124 #[doc = " set all elements to zero"]
125 #[doc = ""]
126 #[doc = "\\param s vector to modify"]
127 pub fn fvec_zeros(s: *mut fvec_t);
128}
129extern "C" {
130 #[doc = " set all elements to ones"]
131 #[doc = ""]
132 #[doc = "\\param s vector to modify"]
133 pub fn fvec_ones(s: *mut fvec_t);
134}
135extern "C" {
136 #[doc = " revert order of vector elements"]
137 #[doc = ""]
138 #[doc = "\\param s vector to revert"]
139 pub fn fvec_rev(s: *mut fvec_t);
140}
141extern "C" {
142 #[doc = " apply weight to vector"]
143 #[doc = ""]
144 #[doc = "If the weight vector is longer than s, only the first elements are used. If"]
145 #[doc = "the weight vector is shorter than s, the last elements of s are not weighted."]
146 #[doc = ""]
147 #[doc = "\\param s vector to weight"]
148 #[doc = "\\param weight weighting coefficients"]
149 pub fn fvec_weight(s: *mut fvec_t, weight: *const fvec_t);
150}
151extern "C" {
152 #[doc = " make a copy of a vector"]
153 #[doc = ""]
154 #[doc = "\\param s source vector"]
155 #[doc = "\\param t vector to copy to"]
156 pub fn fvec_copy(s: *const fvec_t, t: *mut fvec_t);
157}
158extern "C" {
159 #[doc = " make a copy of a vector, applying weights to each element"]
160 #[doc = ""]
161 #[doc = "\\param in input vector"]
162 #[doc = "\\param weight weights vector"]
163 #[doc = "\\param out output vector"]
164 pub fn fvec_weighted_copy(in_: *const fvec_t, weight: *const fvec_t, out: *mut fvec_t);
165}
166#[doc = " Vector of real-valued phase and spectrum data"]
167#[doc = ""]
168#[doc = "\\code"]
169#[doc = ""]
170#[doc = "uint_t buffer_size = 1024;"]
171#[doc = ""]
172#[doc = "cvec_t * input = new_cvec (buffer_size);"]
173#[doc = ""]
174#[doc = "input->norm[23] = 2.;"]
175#[doc = "input->phas[23] = M_PI;"]
176#[doc = ""]
177#[doc = "mean = cvec_mean(input);"]
178#[doc = ""]
179#[doc = "del_cvec (input);"]
180#[doc = ""]
181#[doc = "\\endcode"]
182#[doc = ""]
183#[repr(C)]
184#[derive(Debug, Copy, Clone)]
185pub struct cvec_t {
186 #[doc = "< length of buffer = (requested length)/2 + 1"]
187 pub length: uint_t,
188 #[doc = "< norm array of size ::cvec_t.length"]
189 pub norm: *mut smpl_t,
190 #[doc = "< phase array of size ::cvec_t.length"]
191 pub phas: *mut smpl_t,
192}
193#[test]
194fn bindgen_test_layout_cvec_t() {
195 assert_eq!(
196 ::std::mem::size_of::<cvec_t>(),
197 24usize,
198 concat!("Size of: ", stringify!(cvec_t))
199 );
200 assert_eq!(
201 ::std::mem::align_of::<cvec_t>(),
202 8usize,
203 concat!("Alignment of ", stringify!(cvec_t))
204 );
205 assert_eq!(
206 unsafe { &(*(::std::ptr::null::<cvec_t>())).length as *const _ as usize },
207 0usize,
208 concat!(
209 "Offset of field: ",
210 stringify!(cvec_t),
211 "::",
212 stringify!(length)
213 )
214 );
215 assert_eq!(
216 unsafe { &(*(::std::ptr::null::<cvec_t>())).norm as *const _ as usize },
217 8usize,
218 concat!(
219 "Offset of field: ",
220 stringify!(cvec_t),
221 "::",
222 stringify!(norm)
223 )
224 );
225 assert_eq!(
226 unsafe { &(*(::std::ptr::null::<cvec_t>())).phas as *const _ as usize },
227 16usize,
228 concat!(
229 "Offset of field: ",
230 stringify!(cvec_t),
231 "::",
232 stringify!(phas)
233 )
234 );
235}
236extern "C" {
237 #[doc = " cvec_t buffer creation function"]
238 #[doc = ""]
239 #[doc = "This function creates a cvec_t structure holding two arrays of size"]
240 #[doc = "[length/2+1], corresponding to the norm and phase values of the"]
241 #[doc = "spectral frame. The length stored in the structure is the actual size of both"]
242 #[doc = "arrays, not the length of the complex and symmetrical vector, specified as"]
243 #[doc = "creation argument."]
244 #[doc = ""]
245 #[doc = "\\param length the length of the buffer to create"]
246 pub fn new_cvec(length: uint_t) -> *mut cvec_t;
247}
248extern "C" {
249 #[doc = " cvec_t buffer deletion function"]
250 #[doc = ""]
251 #[doc = "\\param s buffer to delete as returned by new_cvec()"]
252 pub fn del_cvec(s: *mut cvec_t);
253}
254extern "C" {
255 #[doc = " write norm value in a complex buffer"]
256 #[doc = ""]
257 #[doc = "This is equivalent to:"]
258 #[doc = "\\code"]
259 #[doc = "s->norm[position] = val;"]
260 #[doc = "\\endcode"]
261 #[doc = ""]
262 #[doc = "\\param s vector to write to"]
263 #[doc = "\\param val norm value to write in s->norm[position]"]
264 #[doc = "\\param position sample position to write to"]
265 pub fn cvec_norm_set_sample(s: *mut cvec_t, val: smpl_t, position: uint_t);
266}
267extern "C" {
268 #[doc = " write phase value in a complex buffer"]
269 #[doc = ""]
270 #[doc = "This is equivalent to:"]
271 #[doc = "\\code"]
272 #[doc = "s->phas[position] = val;"]
273 #[doc = "\\endcode"]
274 #[doc = ""]
275 #[doc = "\\param s vector to write to"]
276 #[doc = "\\param val phase value to write in s->phas[position]"]
277 #[doc = "\\param position sample position to write to"]
278 pub fn cvec_phas_set_sample(s: *mut cvec_t, val: smpl_t, position: uint_t);
279}
280extern "C" {
281 #[doc = " read norm value from a complex buffer"]
282 #[doc = ""]
283 #[doc = "This is equivalent to:"]
284 #[doc = "\\code"]
285 #[doc = "smpl_t foo = s->norm[position];"]
286 #[doc = "\\endcode"]
287 #[doc = ""]
288 #[doc = "\\param s vector to read from"]
289 #[doc = "\\param position sample position to read from"]
290 pub fn cvec_norm_get_sample(s: *mut cvec_t, position: uint_t) -> smpl_t;
291}
292extern "C" {
293 #[doc = " read phase value from a complex buffer"]
294 #[doc = ""]
295 #[doc = "This is equivalent to:"]
296 #[doc = "\\code"]
297 #[doc = "smpl_t foo = s->phas[position];"]
298 #[doc = "\\endcode"]
299 #[doc = ""]
300 #[doc = "\\param s vector to read from"]
301 #[doc = "\\param position sample position to read from"]
302 #[doc = "\\returns the value of the sample at position"]
303 pub fn cvec_phas_get_sample(s: *mut cvec_t, position: uint_t) -> smpl_t;
304}
305extern "C" {
306 #[doc = " read norm data from a complex buffer"]
307 #[doc = ""]
308 #[doc = "\\code"]
309 #[doc = "smpl_t *data = s->norm;"]
310 #[doc = "\\endcode"]
311 #[doc = ""]
312 #[doc = "\\param s vector to read from"]
313 pub fn cvec_norm_get_data(s: *const cvec_t) -> *mut smpl_t;
314}
315extern "C" {
316 #[doc = " read phase data from a complex buffer"]
317 #[doc = ""]
318 #[doc = "This is equivalent to:"]
319 #[doc = "\\code"]
320 #[doc = "smpl_t *data = s->phas;"]
321 #[doc = "\\endcode"]
322 #[doc = ""]
323 #[doc = "\\param s vector to read from"]
324 pub fn cvec_phas_get_data(s: *const cvec_t) -> *mut smpl_t;
325}
326extern "C" {
327 #[doc = " print out cvec data"]
328 #[doc = ""]
329 #[doc = "\\param s vector to print out"]
330 pub fn cvec_print(s: *const cvec_t);
331}
332extern "C" {
333 #[doc = " make a copy of a vector"]
334 #[doc = ""]
335 #[doc = "\\param s source vector"]
336 #[doc = "\\param t vector to copy to"]
337 pub fn cvec_copy(s: *const cvec_t, t: *mut cvec_t);
338}
339extern "C" {
340 #[doc = " set all norm elements to a given value"]
341 #[doc = ""]
342 #[doc = "\\param s vector to modify"]
343 #[doc = "\\param val value to set elements to"]
344 pub fn cvec_norm_set_all(s: *mut cvec_t, val: smpl_t);
345}
346extern "C" {
347 #[doc = " set all norm elements to zero"]
348 #[doc = ""]
349 #[doc = "\\param s vector to modify"]
350 pub fn cvec_norm_zeros(s: *mut cvec_t);
351}
352extern "C" {
353 #[doc = " set all norm elements to one"]
354 #[doc = ""]
355 #[doc = "\\param s vector to modify"]
356 pub fn cvec_norm_ones(s: *mut cvec_t);
357}
358extern "C" {
359 #[doc = " set all phase elements to a given value"]
360 #[doc = ""]
361 #[doc = "\\param s vector to modify"]
362 #[doc = "\\param val value to set elements to"]
363 pub fn cvec_phas_set_all(s: *mut cvec_t, val: smpl_t);
364}
365extern "C" {
366 #[doc = " set all phase elements to zero"]
367 #[doc = ""]
368 #[doc = "\\param s vector to modify"]
369 pub fn cvec_phas_zeros(s: *mut cvec_t);
370}
371extern "C" {
372 #[doc = " set all phase elements to one"]
373 #[doc = ""]
374 #[doc = "\\param s vector to modify"]
375 pub fn cvec_phas_ones(s: *mut cvec_t);
376}
377extern "C" {
378 #[doc = " set all norm and phas elements to zero"]
379 #[doc = ""]
380 #[doc = "\\param s vector to modify"]
381 pub fn cvec_zeros(s: *mut cvec_t);
382}
383extern "C" {
384 #[doc = " take logarithmic magnitude"]
385 #[doc = ""]
386 #[doc = "\\param s input cvec to compress"]
387 #[doc = "\\param lambda value to use for normalisation"]
388 #[doc = ""]
389 #[doc = "\\f$ S_k = log( \\lambda * S_k + 1 ) \\f$"]
390 pub fn cvec_logmag(s: *mut cvec_t, lambda: smpl_t);
391}
392#[doc = " Buffer for real data in double precision"]
393#[repr(C)]
394#[derive(Debug, Copy, Clone)]
395pub struct lvec_t {
396 #[doc = "< length of buffer"]
397 pub length: uint_t,
398 #[doc = "< data array of size [length]"]
399 pub data: *mut lsmp_t,
400}
401#[test]
402fn bindgen_test_layout_lvec_t() {
403 assert_eq!(
404 ::std::mem::size_of::<lvec_t>(),
405 16usize,
406 concat!("Size of: ", stringify!(lvec_t))
407 );
408 assert_eq!(
409 ::std::mem::align_of::<lvec_t>(),
410 8usize,
411 concat!("Alignment of ", stringify!(lvec_t))
412 );
413 assert_eq!(
414 unsafe { &(*(::std::ptr::null::<lvec_t>())).length as *const _ as usize },
415 0usize,
416 concat!(
417 "Offset of field: ",
418 stringify!(lvec_t),
419 "::",
420 stringify!(length)
421 )
422 );
423 assert_eq!(
424 unsafe { &(*(::std::ptr::null::<lvec_t>())).data as *const _ as usize },
425 8usize,
426 concat!(
427 "Offset of field: ",
428 stringify!(lvec_t),
429 "::",
430 stringify!(data)
431 )
432 );
433}
434extern "C" {
435 #[doc = " lvec_t buffer creation function"]
436 #[doc = ""]
437 #[doc = "\\param length the length of the buffer to create"]
438 pub fn new_lvec(length: uint_t) -> *mut lvec_t;
439}
440extern "C" {
441 #[doc = " lvec_t buffer deletion function"]
442 #[doc = ""]
443 #[doc = "\\param s buffer to delete as returned by new_lvec()"]
444 pub fn del_lvec(s: *mut lvec_t);
445}
446extern "C" {
447 #[doc = " read sample value in a buffer"]
448 #[doc = ""]
449 #[doc = "\\param s vector to read from"]
450 #[doc = "\\param position sample position to read from"]
451 pub fn lvec_get_sample(s: *mut lvec_t, position: uint_t) -> lsmp_t;
452}
453extern "C" {
454 #[doc = " write sample value in a buffer"]
455 #[doc = ""]
456 #[doc = "\\param s vector to write to"]
457 #[doc = "\\param data value to write in s->data[position]"]
458 #[doc = "\\param position sample position to write to"]
459 pub fn lvec_set_sample(s: *mut lvec_t, data: lsmp_t, position: uint_t);
460}
461extern "C" {
462 #[doc = " read data from a buffer"]
463 #[doc = ""]
464 #[doc = "\\param s vector to read from"]
465 pub fn lvec_get_data(s: *const lvec_t) -> *mut lsmp_t;
466}
467extern "C" {
468 #[doc = " print out lvec data"]
469 #[doc = ""]
470 #[doc = "\\param s vector to print out"]
471 pub fn lvec_print(s: *const lvec_t);
472}
473extern "C" {
474 #[doc = " set all elements to a given value"]
475 #[doc = ""]
476 #[doc = "\\param s vector to modify"]
477 #[doc = "\\param val value to set elements to"]
478 pub fn lvec_set_all(s: *mut lvec_t, val: smpl_t);
479}
480extern "C" {
481 #[doc = " set all elements to zero"]
482 #[doc = ""]
483 #[doc = "\\param s vector to modify"]
484 pub fn lvec_zeros(s: *mut lvec_t);
485}
486extern "C" {
487 #[doc = " set all elements to ones"]
488 #[doc = ""]
489 #[doc = "\\param s vector to modify"]
490 pub fn lvec_ones(s: *mut lvec_t);
491}
492#[doc = " Buffer for real data"]
493#[repr(C)]
494#[derive(Debug, Copy, Clone)]
495pub struct fmat_t {
496 #[doc = "< length of matrix"]
497 pub length: uint_t,
498 #[doc = "< height of matrix"]
499 pub height: uint_t,
500 #[doc = "< data array of size [length] * [height]"]
501 pub data: *mut *mut smpl_t,
502}
503#[test]
504fn bindgen_test_layout_fmat_t() {
505 assert_eq!(
506 ::std::mem::size_of::<fmat_t>(),
507 16usize,
508 concat!("Size of: ", stringify!(fmat_t))
509 );
510 assert_eq!(
511 ::std::mem::align_of::<fmat_t>(),
512 8usize,
513 concat!("Alignment of ", stringify!(fmat_t))
514 );
515 assert_eq!(
516 unsafe { &(*(::std::ptr::null::<fmat_t>())).length as *const _ as usize },
517 0usize,
518 concat!(
519 "Offset of field: ",
520 stringify!(fmat_t),
521 "::",
522 stringify!(length)
523 )
524 );
525 assert_eq!(
526 unsafe { &(*(::std::ptr::null::<fmat_t>())).height as *const _ as usize },
527 4usize,
528 concat!(
529 "Offset of field: ",
530 stringify!(fmat_t),
531 "::",
532 stringify!(height)
533 )
534 );
535 assert_eq!(
536 unsafe { &(*(::std::ptr::null::<fmat_t>())).data as *const _ as usize },
537 8usize,
538 concat!(
539 "Offset of field: ",
540 stringify!(fmat_t),
541 "::",
542 stringify!(data)
543 )
544 );
545}
546extern "C" {
547 #[doc = " fmat_t buffer creation function"]
548 #[doc = ""]
549 #[doc = "\\param length the length of the matrix to create"]
550 #[doc = "\\param height the height of the matrix to create"]
551 pub fn new_fmat(height: uint_t, length: uint_t) -> *mut fmat_t;
552}
553extern "C" {
554 #[doc = " fmat_t buffer deletion function"]
555 #[doc = ""]
556 #[doc = "\\param s buffer to delete as returned by new_fmat()"]
557 pub fn del_fmat(s: *mut fmat_t);
558}
559extern "C" {
560 #[doc = " read sample value in a buffer"]
561 #[doc = ""]
562 #[doc = "\\param s vector to read from"]
563 #[doc = "\\param channel channel to read from"]
564 #[doc = "\\param position sample position to read from"]
565 pub fn fmat_get_sample(s: *const fmat_t, channel: uint_t, position: uint_t) -> smpl_t;
566}
567extern "C" {
568 #[doc = " write sample value in a buffer"]
569 #[doc = ""]
570 #[doc = "\\param s vector to write to"]
571 #[doc = "\\param data value to write in s->data[channel][position]"]
572 #[doc = "\\param channel channel to write to"]
573 #[doc = "\\param position sample position to write to"]
574 pub fn fmat_set_sample(s: *mut fmat_t, data: smpl_t, channel: uint_t, position: uint_t);
575}
576extern "C" {
577 #[doc = " read channel vector from a buffer"]
578 #[doc = ""]
579 #[doc = "\\param s vector to read from"]
580 #[doc = "\\param channel channel to read from"]
581 #[doc = "\\param output ::fvec_t to output to"]
582 pub fn fmat_get_channel(s: *const fmat_t, channel: uint_t, output: *mut fvec_t);
583}
584extern "C" {
585 #[doc = " get vector buffer from an fmat data"]
586 #[doc = ""]
587 #[doc = "\\param s vector to read from"]
588 #[doc = "\\param channel channel to read from"]
589 pub fn fmat_get_channel_data(s: *const fmat_t, channel: uint_t) -> *mut smpl_t;
590}
591extern "C" {
592 #[doc = " read data from a buffer"]
593 #[doc = ""]
594 #[doc = "\\param s vector to read from"]
595 pub fn fmat_get_data(s: *const fmat_t) -> *mut *mut smpl_t;
596}
597extern "C" {
598 #[doc = " print out fmat data"]
599 #[doc = ""]
600 #[doc = "\\param s vector to print out"]
601 pub fn fmat_print(s: *const fmat_t);
602}
603extern "C" {
604 #[doc = " set all elements to a given value"]
605 #[doc = ""]
606 #[doc = "\\param s vector to modify"]
607 #[doc = "\\param val value to set elements to"]
608 pub fn fmat_set(s: *mut fmat_t, val: smpl_t);
609}
610extern "C" {
611 #[doc = " set all elements to zero"]
612 #[doc = ""]
613 #[doc = "\\param s vector to modify"]
614 pub fn fmat_zeros(s: *mut fmat_t);
615}
616extern "C" {
617 #[doc = " set all elements to ones"]
618 #[doc = ""]
619 #[doc = "\\param s vector to modify"]
620 pub fn fmat_ones(s: *mut fmat_t);
621}
622extern "C" {
623 #[doc = " revert order of vector elements"]
624 #[doc = ""]
625 #[doc = "\\param s vector to revert"]
626 pub fn fmat_rev(s: *mut fmat_t);
627}
628extern "C" {
629 #[doc = " apply weight to vector"]
630 #[doc = ""]
631 #[doc = "If the weight vector is longer than s, only the first elements are used. If"]
632 #[doc = "the weight vector is shorter than s, the last elements of s are not weighted."]
633 #[doc = ""]
634 #[doc = "\\param s vector to weight"]
635 #[doc = "\\param weight weighting coefficients"]
636 pub fn fmat_weight(s: *mut fmat_t, weight: *const fmat_t);
637}
638extern "C" {
639 #[doc = " make a copy of a matrix"]
640 #[doc = ""]
641 #[doc = "\\param s source vector"]
642 #[doc = "\\param t vector to copy to"]
643 pub fn fmat_copy(s: *const fmat_t, t: *mut fmat_t);
644}
645extern "C" {
646 #[doc = " compute the product of a matrix by a vector"]
647 #[doc = ""]
648 #[doc = "\\param s matrix to compute product with"]
649 #[doc = "\\param scale vector to compute product with"]
650 #[doc = "\\param output vector to store restults in"]
651 pub fn fmat_vecmul(s: *const fmat_t, scale: *const fvec_t, output: *mut fvec_t);
652}
653extern "C" {
654 #[doc = " create window"]
655 #[doc = ""]
656 #[doc = "\\param window_type type of the window to create"]
657 #[doc = "\\param size length of the window to create (see fvec_set_window())"]
658 pub fn new_aubio_window(window_type: *mut char_t, size: uint_t) -> *mut fvec_t;
659}
660extern "C" {
661 #[doc = " set elements of a vector to window coefficients"]
662 #[doc = ""]
663 #[doc = "\\param window exsting ::fvec_t to use"]
664 #[doc = "\\param window_type type of the window to create"]
665 #[doc = ""]
666 #[doc = "List of available window types: \"rectangle\", \"hamming\", \"hanning\","]
667 #[doc = "\"hanningz\", \"blackman\", \"blackman_harris\", \"gaussian\", \"welch\", \"parzen\","]
668 #[doc = "\"default\"."]
669 #[doc = ""]
670 #[doc = "\"default\" is equivalent to \"hanningz\"."]
671 #[doc = ""]
672 #[doc = "References:"]
673 #[doc = ""]
674 #[doc = "- <a href=\"http://en.wikipedia.org/wiki/Window_function\">Window"]
675 #[doc = "function</a> on Wikipedia"]
676 #[doc = "- Amalia de Götzen, Nicolas Bernardini, and Daniel Arfib. Traditional (?)"]
677 #[doc = "implementations of a phase vocoder: the tricks of the trade. In Proceedings of"]
678 #[doc = "the International Conference on Digital Audio Effects (DAFx-00), pages 37–44,"]
679 #[doc = "Uni- versity of Verona, Italy, 2000."]
680 #[doc = "(<a href=\"http://www.cs.princeton.edu/courses/archive/spr09/cos325/Bernardini.pdf\">"]
681 #[doc = "pdf</a>)"]
682 #[doc = ""]
683 pub fn fvec_set_window(window: *mut fvec_t, window_type: *mut char_t) -> uint_t;
684}
685extern "C" {
686 #[doc = " compute the principal argument"]
687 #[doc = ""]
688 #[doc = "This function maps the input phase to its corresponding value wrapped in the"]
689 #[doc = "range \\f$ [-\\pi, \\pi] \\f$."]
690 #[doc = ""]
691 #[doc = "\\param phase unwrapped phase to map to the unit circle"]
692 #[doc = ""]
693 #[doc = "\\return equivalent phase wrapped to the unit circle"]
694 pub fn aubio_unwrap2pi(phase: smpl_t) -> smpl_t;
695}
696extern "C" {
697 #[doc = " convert frequency bin to midi value"]
698 pub fn aubio_bintomidi(bin: smpl_t, samplerate: smpl_t, fftsize: smpl_t) -> smpl_t;
699}
700extern "C" {
701 #[doc = " convert midi value to frequency bin"]
702 pub fn aubio_miditobin(midi: smpl_t, samplerate: smpl_t, fftsize: smpl_t) -> smpl_t;
703}
704extern "C" {
705 #[doc = " convert frequency bin to frequency (Hz)"]
706 pub fn aubio_bintofreq(bin: smpl_t, samplerate: smpl_t, fftsize: smpl_t) -> smpl_t;
707}
708extern "C" {
709 #[doc = " convert frequency (Hz) to frequency bin"]
710 pub fn aubio_freqtobin(freq: smpl_t, samplerate: smpl_t, fftsize: smpl_t) -> smpl_t;
711}
712extern "C" {
713 #[doc = " convert frequency (Hz) to mel"]
714 #[doc = ""]
715 #[doc = "\\param freq input frequency, in Hz"]
716 #[doc = ""]
717 #[doc = "\\return output mel"]
718 #[doc = ""]
719 #[doc = "Converts a scalar from the frequency domain to the mel scale using Slaney"]
720 #[doc = "Auditory Toolbox's implementation:"]
721 #[doc = ""]
722 #[doc = "If \\f$ f < 1000 \\f$, \\f$ m = 3 f / 200 \\f$."]
723 #[doc = ""]
724 #[doc = "If \\f$ f >= 1000 \\f$, \\f$ m = 1000 + 27 \\frac{{ln}(f) - ln(1000))}"]
725 #[doc = "{{ln}(6400) - ln(1000)}"]
726 #[doc = "\\f$"]
727 #[doc = ""]
728 #[doc = "See also"]
729 #[doc = "--------"]
730 #[doc = ""]
731 #[doc = "aubio_meltohz(), aubio_hztomel_htk()."]
732 pub fn aubio_hztomel(freq: smpl_t) -> smpl_t;
733}
734extern "C" {
735 #[doc = " convert mel to frequency (Hz)"]
736 #[doc = ""]
737 #[doc = "\\param mel input mel"]
738 #[doc = ""]
739 #[doc = "\\return output frequency, in Hz"]
740 #[doc = ""]
741 #[doc = "Converts a scalar from the mel scale to the frequency domain using Slaney"]
742 #[doc = "Auditory Toolbox's implementation:"]
743 #[doc = ""]
744 #[doc = "If \\f$ f < 1000 \\f$, \\f$ f = 200 m/3 \\f$."]
745 #[doc = ""]
746 #[doc = "If \\f$ f \\geq 1000 \\f$, \\f$ f = 1000 + \\left(\\frac{6400}{1000}\\right)"]
747 #[doc = "^{\\frac{m - 1000}{27}} \\f$"]
748 #[doc = ""]
749 #[doc = "See also"]
750 #[doc = "--------"]
751 #[doc = ""]
752 #[doc = "aubio_hztomel(), aubio_meltohz_htk()."]
753 #[doc = ""]
754 #[doc = "References"]
755 #[doc = "----------"]
756 #[doc = ""]
757 #[doc = "Malcolm Slaney, *Auditory Toolbox Version 2, Technical Report #1998-010*"]
758 #[doc = "https://engineering.purdue.edu/~malcolm/interval/1998-010/"]
759 pub fn aubio_meltohz(mel: smpl_t) -> smpl_t;
760}
761extern "C" {
762 #[doc = " convert frequency (Hz) to mel"]
763 #[doc = ""]
764 #[doc = "\\param freq input frequency, in Hz"]
765 #[doc = ""]
766 #[doc = "\\return output mel"]
767 #[doc = ""]
768 #[doc = "Converts a scalar from the frequency domain to the mel scale, using the"]
769 #[doc = "equation defined by O'Shaughnessy, as implemented in the HTK speech"]
770 #[doc = "recognition toolkit:"]
771 #[doc = ""]
772 #[doc = "\\f$ m = 1127 + ln(1 + \\frac{f}{700}) \\f$"]
773 #[doc = ""]
774 #[doc = "See also"]
775 #[doc = "--------"]
776 #[doc = ""]
777 #[doc = "aubio_meltohz_htk(), aubio_hztomel()."]
778 #[doc = ""]
779 #[doc = "References"]
780 #[doc = "----------"]
781 #[doc = ""]
782 #[doc = "Douglas O'Shaughnessy (1987). *Speech communication: human and machine*."]
783 #[doc = "Addison-Wesley. p. 150. ISBN 978-0-201-16520-3."]
784 #[doc = ""]
785 #[doc = "HTK Speech Recognition Toolkit: http://htk.eng.cam.ac.uk/"]
786 #[doc = ""]
787 pub fn aubio_hztomel_htk(freq: smpl_t) -> smpl_t;
788}
789extern "C" {
790 #[doc = " convert mel to frequency (Hz)"]
791 #[doc = ""]
792 #[doc = "\\param mel input mel"]
793 #[doc = ""]
794 #[doc = "\\return output frequency, in Hz"]
795 #[doc = ""]
796 #[doc = "Converts a scalar from the mel scale to the frequency domain, using the"]
797 #[doc = "equation defined by O'Shaughnessy, as implemented in the HTK speech"]
798 #[doc = "recognition toolkit:"]
799 #[doc = ""]
800 #[doc = "\\f$ f = 700 * {e}^\\left(\\frac{f}{1127} - 1\\right) \\f$"]
801 #[doc = ""]
802 #[doc = "See also"]
803 #[doc = "--------"]
804 #[doc = ""]
805 #[doc = "aubio_hztomel_htk(), aubio_meltohz()."]
806 pub fn aubio_meltohz_htk(mel: smpl_t) -> smpl_t;
807}
808extern "C" {
809 #[doc = " convert frequency (Hz) to midi value (0-128)"]
810 pub fn aubio_freqtomidi(freq: smpl_t) -> smpl_t;
811}
812extern "C" {
813 #[doc = " convert midi value (0-128) to frequency (Hz)"]
814 pub fn aubio_miditofreq(midi: smpl_t) -> smpl_t;
815}
816extern "C" {
817 #[doc = " clean up cached memory at the end of program"]
818 #[doc = ""]
819 #[doc = "This function should be used at the end of programs to purge all cached"]
820 #[doc = "memory. So far it is only useful to clean FFTW's cache."]
821 pub fn aubio_cleanup();
822}
823extern "C" {
824 #[doc = " zero-crossing rate (ZCR)"]
825 #[doc = ""]
826 #[doc = "The zero-crossing rate is the number of times a signal changes sign,"]
827 #[doc = "divided by the length of this signal."]
828 #[doc = ""]
829 #[doc = "\\param v vector to compute ZCR from"]
830 #[doc = ""]
831 #[doc = "\\return zero-crossing rate of v"]
832 pub fn aubio_zero_crossing_rate(v: *mut fvec_t) -> smpl_t;
833}
834extern "C" {
835 #[doc = " compute sound level on a linear scale"]
836 #[doc = ""]
837 #[doc = "This gives the average of the square amplitudes."]
838 #[doc = ""]
839 #[doc = "\\param v vector to compute level from"]
840 #[doc = ""]
841 #[doc = "\\return level of v"]
842 pub fn aubio_level_lin(v: *const fvec_t) -> smpl_t;
843}
844extern "C" {
845 #[doc = " compute sound pressure level (SPL) in dB"]
846 #[doc = ""]
847 #[doc = "This quantity is often wrongly called 'loudness'."]
848 #[doc = ""]
849 #[doc = "This gives ten times the log10 of the average of the square amplitudes."]
850 #[doc = ""]
851 #[doc = "\\param v vector to compute dB SPL from"]
852 #[doc = ""]
853 #[doc = "\\return level of v in dB SPL"]
854 pub fn aubio_db_spl(v: *const fvec_t) -> smpl_t;
855}
856extern "C" {
857 #[doc = " check if buffer level in dB SPL is under a given threshold"]
858 #[doc = ""]
859 #[doc = "\\param v vector to get level from"]
860 #[doc = "\\param threshold threshold in dB SPL"]
861 #[doc = ""]
862 #[doc = "\\return 1 if level is under the given threshold, 0 otherwise"]
863 pub fn aubio_silence_detection(v: *const fvec_t, threshold: smpl_t) -> uint_t;
864}
865extern "C" {
866 #[doc = " get buffer level if level >= threshold, 1. otherwise"]
867 #[doc = ""]
868 #[doc = "\\param v vector to get level from"]
869 #[doc = "\\param threshold threshold in dB SPL"]
870 #[doc = ""]
871 #[doc = "\\return level in dB SPL if level >= threshold, 1. otherwise"]
872 pub fn aubio_level_detection(v: *const fvec_t, threshold: smpl_t) -> smpl_t;
873}
874extern "C" {
875 #[doc = " clamp the values of a vector within the range [-abs(max), abs(max)]"]
876 #[doc = ""]
877 #[doc = "\\param in vector to clamp"]
878 #[doc = "\\param absmax maximum value over which input vector elements should be clamped"]
879 pub fn fvec_clamp(in_: *mut fvec_t, absmax: smpl_t);
880}
881extern "C" {
882 #[doc = " compute \\f$e^x\\f$ of each vector elements"]
883 #[doc = ""]
884 #[doc = "\\param s vector to modify"]
885 pub fn fvec_exp(s: *mut fvec_t);
886}
887extern "C" {
888 #[doc = " compute \\f$cos(x)\\f$ of each vector elements"]
889 #[doc = ""]
890 #[doc = "\\param s vector to modify"]
891 pub fn fvec_cos(s: *mut fvec_t);
892}
893extern "C" {
894 #[doc = " compute \\f$sin(x)\\f$ of each vector elements"]
895 #[doc = ""]
896 #[doc = "\\param s vector to modify"]
897 pub fn fvec_sin(s: *mut fvec_t);
898}
899extern "C" {
900 #[doc = " compute the \\f$abs(x)\\f$ of each vector elements"]
901 #[doc = ""]
902 #[doc = "\\param s vector to modify"]
903 pub fn fvec_abs(s: *mut fvec_t);
904}
905extern "C" {
906 #[doc = " compute the \\f$sqrt(x)\\f$ of each vector elements"]
907 #[doc = ""]
908 #[doc = "\\param s vector to modify"]
909 pub fn fvec_sqrt(s: *mut fvec_t);
910}
911extern "C" {
912 #[doc = " compute the \\f$log10(x)\\f$ of each vector elements"]
913 #[doc = ""]
914 #[doc = "\\param s vector to modify"]
915 pub fn fvec_log10(s: *mut fvec_t);
916}
917extern "C" {
918 #[doc = " compute the \\f$log(x)\\f$ of each vector elements"]
919 #[doc = ""]
920 #[doc = "\\param s vector to modify"]
921 pub fn fvec_log(s: *mut fvec_t);
922}
923extern "C" {
924 #[doc = " compute the \\f$floor(x)\\f$ of each vector elements"]
925 #[doc = ""]
926 #[doc = "\\param s vector to modify"]
927 pub fn fvec_floor(s: *mut fvec_t);
928}
929extern "C" {
930 #[doc = " compute the \\f$ceil(x)\\f$ of each vector elements"]
931 #[doc = ""]
932 #[doc = "\\param s vector to modify"]
933 pub fn fvec_ceil(s: *mut fvec_t);
934}
935extern "C" {
936 #[doc = " compute the \\f$round(x)\\f$ of each vector elements"]
937 #[doc = ""]
938 #[doc = "\\param s vector to modify"]
939 pub fn fvec_round(s: *mut fvec_t);
940}
941extern "C" {
942 #[doc = " raise each vector elements to the power pow"]
943 #[doc = ""]
944 #[doc = "\\param s vector to modify"]
945 #[doc = "\\param pow power to raise to"]
946 pub fn fvec_pow(s: *mut fvec_t, pow: smpl_t);
947}
948#[repr(C)]
949#[derive(Debug, Copy, Clone)]
950pub struct _aubio_resampler_t {
951 _unused: [u8; 0],
952}
953#[doc = " resampler object"]
954pub type aubio_resampler_t = _aubio_resampler_t;
955extern "C" {
956 #[doc = " create resampler object"]
957 #[doc = ""]
958 #[doc = "\\param ratio output_sample_rate / input_sample_rate"]
959 #[doc = "\\param type libsamplerate resampling type, see http://www.mega-nerd.com/SRC/api_misc.html#Converters"]
960 pub fn new_aubio_resampler(ratio: smpl_t, type_: uint_t) -> *mut aubio_resampler_t;
961}
962extern "C" {
963 #[doc = " delete resampler object"]
964 pub fn del_aubio_resampler(s: *mut aubio_resampler_t);
965}
966extern "C" {
967 #[doc = " resample input in output"]
968 #[doc = ""]
969 #[doc = "\\param s resampler object"]
970 #[doc = "\\param input input buffer of size N"]
971 #[doc = "\\param output output buffer of size N*ratio"]
972 pub fn aubio_resampler_do(s: *mut aubio_resampler_t, input: *const fvec_t, output: *mut fvec_t);
973}
974#[repr(C)]
975#[derive(Debug, Copy, Clone)]
976pub struct _aubio_filter_t {
977 _unused: [u8; 0],
978}
979#[doc = " Digital filter"]
980pub type aubio_filter_t = _aubio_filter_t;
981extern "C" {
982 #[doc = " filter input vector (in-place)"]
983 #[doc = ""]
984 #[doc = "\\param f filter object as returned by new_aubio_filter()"]
985 #[doc = "\\param in input vector to filter"]
986 pub fn aubio_filter_do(f: *mut aubio_filter_t, in_: *mut fvec_t);
987}
988extern "C" {
989 #[doc = " filter input vector (out-of-place)"]
990 #[doc = ""]
991 #[doc = "\\param f filter object as returned by new_aubio_filter()"]
992 #[doc = "\\param in input vector to filter"]
993 #[doc = "\\param out output vector to store filtered input"]
994 pub fn aubio_filter_do_outplace(f: *mut aubio_filter_t, in_: *const fvec_t, out: *mut fvec_t);
995}
996extern "C" {
997 #[doc = " filter input vector forward and backward"]
998 #[doc = ""]
999 #[doc = "\\param f ::aubio_filter_t object as returned by new_aubio_filter()"]
1000 #[doc = "\\param in ::fvec_t input vector to filter"]
1001 #[doc = "\\param tmp memory space to use for computation"]
1002 pub fn aubio_filter_do_filtfilt(f: *mut aubio_filter_t, in_: *mut fvec_t, tmp: *mut fvec_t);
1003}
1004extern "C" {
1005 #[doc = " returns a pointer to feedback coefficients \\f$ a_i \\f$"]
1006 #[doc = ""]
1007 #[doc = "\\param f filter object to get parameters from"]
1008 #[doc = ""]
1009 #[doc = "\\return a pointer to the \\f$ a_0 ... a_i ... a_P \\f$ coefficients"]
1010 pub fn aubio_filter_get_feedback(f: *const aubio_filter_t) -> *mut lvec_t;
1011}
1012extern "C" {
1013 #[doc = " returns a pointer to feedforward coefficients \\f$ b_i \\f$"]
1014 #[doc = ""]
1015 #[doc = "\\param f filter object to get coefficients from"]
1016 #[doc = ""]
1017 #[doc = "\\return a pointer to the \\f$ b_0 ... b_i ... b_P \\f$ coefficients"]
1018 pub fn aubio_filter_get_feedforward(f: *const aubio_filter_t) -> *mut lvec_t;
1019}
1020extern "C" {
1021 #[doc = " get order of the filter"]
1022 #[doc = ""]
1023 #[doc = "\\param f filter to get order from"]
1024 #[doc = ""]
1025 #[doc = "\\return the order of the filter"]
1026 pub fn aubio_filter_get_order(f: *const aubio_filter_t) -> uint_t;
1027}
1028extern "C" {
1029 #[doc = " get sampling rate of the filter"]
1030 #[doc = ""]
1031 #[doc = "\\param f filter to get sampling rate from"]
1032 #[doc = ""]
1033 #[doc = "\\return the sampling rate of the filter, in Hz"]
1034 pub fn aubio_filter_get_samplerate(f: *const aubio_filter_t) -> uint_t;
1035}
1036extern "C" {
1037 #[doc = " get sampling rate of the filter"]
1038 #[doc = ""]
1039 #[doc = "\\param f filter to get sampling rate from"]
1040 #[doc = "\\param samplerate sample rate to set the filter to"]
1041 #[doc = ""]
1042 #[doc = "\\return the sampling rate of the filter, in Hz"]
1043 pub fn aubio_filter_set_samplerate(f: *mut aubio_filter_t, samplerate: uint_t) -> uint_t;
1044}
1045extern "C" {
1046 #[doc = " reset filter memory"]
1047 #[doc = ""]
1048 #[doc = "\\param f filter object as returned by new_aubio_filter()"]
1049 pub fn aubio_filter_do_reset(f: *mut aubio_filter_t);
1050}
1051extern "C" {
1052 #[doc = " create new filter object"]
1053 #[doc = ""]
1054 #[doc = "This function creates a new ::aubio_filter_t object, given the order of the"]
1055 #[doc = "filter."]
1056 #[doc = ""]
1057 #[doc = "\\param order order of the filter (number of coefficients)"]
1058 #[doc = ""]
1059 #[doc = "\\return the newly created filter object"]
1060 pub fn new_aubio_filter(order: uint_t) -> *mut aubio_filter_t;
1061}
1062extern "C" {
1063 #[doc = " delete a filter object"]
1064 #[doc = ""]
1065 #[doc = "\\param f filter object to delete"]
1066 pub fn del_aubio_filter(f: *mut aubio_filter_t);
1067}
1068extern "C" {
1069 #[doc = " set coefficients of a biquad filter"]
1070 #[doc = ""]
1071 #[doc = "\\param f filter object as returned by new_aubio_filter()"]
1072 #[doc = "\\param b0 forward filter coefficient"]
1073 #[doc = "\\param b1 forward filter coefficient"]
1074 #[doc = "\\param b2 forward filter coefficient"]
1075 #[doc = "\\param a1 feedback filter coefficient"]
1076 #[doc = "\\param a2 feedback filter coefficient"]
1077 pub fn aubio_filter_set_biquad(
1078 f: *mut aubio_filter_t,
1079 b0: lsmp_t,
1080 b1: lsmp_t,
1081 b2: lsmp_t,
1082 a1: lsmp_t,
1083 a2: lsmp_t,
1084 ) -> uint_t;
1085}
1086extern "C" {
1087 #[doc = " create biquad filter with `b0`, `b1`, `b2`, `a1`, `a2` coeffs"]
1088 #[doc = ""]
1089 #[doc = "\\param b0 forward filter coefficient"]
1090 #[doc = "\\param b1 forward filter coefficient"]
1091 #[doc = "\\param b2 forward filter coefficient"]
1092 #[doc = "\\param a1 feedback filter coefficient"]
1093 #[doc = "\\param a2 feedback filter coefficient"]
1094 pub fn new_aubio_filter_biquad(
1095 b0: lsmp_t,
1096 b1: lsmp_t,
1097 b2: lsmp_t,
1098 a1: lsmp_t,
1099 a2: lsmp_t,
1100 ) -> *mut aubio_filter_t;
1101}
1102extern "C" {
1103 #[doc = " create new A-design filter"]
1104 #[doc = ""]
1105 #[doc = "\\param samplerate sampling frequency of the signal to filter. Should be one of"]
1106 #[doc = "8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and"]
1107 #[doc = "192000 Hz"]
1108 #[doc = ""]
1109 #[doc = "\\return a new filter object"]
1110 pub fn new_aubio_filter_a_weighting(samplerate: uint_t) -> *mut aubio_filter_t;
1111}
1112extern "C" {
1113 #[doc = " set feedback and feedforward coefficients of a A-weighting filter"]
1114 #[doc = ""]
1115 #[doc = "\\param f filter object to get coefficients from"]
1116 #[doc = "\\param samplerate sampling frequency of the signal to filter. Should be one of"]
1117 #[doc = "8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and"]
1118 #[doc = "192000 Hz"]
1119 pub fn aubio_filter_set_a_weighting(f: *mut aubio_filter_t, samplerate: uint_t) -> uint_t;
1120}
1121extern "C" {
1122 #[doc = " create new C-design filter"]
1123 #[doc = ""]
1124 #[doc = "\\param samplerate sampling frequency of the signal to filter. Should be one of"]
1125 #[doc = "8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and"]
1126 #[doc = "192000 Hz"]
1127 #[doc = ""]
1128 #[doc = "\\return a new filter object"]
1129 pub fn new_aubio_filter_c_weighting(samplerate: uint_t) -> *mut aubio_filter_t;
1130}
1131extern "C" {
1132 #[doc = " set feedback and feedforward coefficients of a C-weighting filter"]
1133 #[doc = ""]
1134 #[doc = "\\param f filter object to get coefficients from"]
1135 #[doc = "\\param samplerate sampling frequency of the signal to filter. Should be one of"]
1136 #[doc = "8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and"]
1137 #[doc = "192000 Hz"]
1138 pub fn aubio_filter_set_c_weighting(f: *mut aubio_filter_t, samplerate: uint_t) -> uint_t;
1139}
1140#[repr(C)]
1141#[derive(Debug, Copy, Clone)]
1142pub struct _aubio_fft_t {
1143 _unused: [u8; 0],
1144}
1145#[doc = " FFT object"]
1146#[doc = ""]
1147#[doc = "This object computes forward and backward FFTs."]
1148pub type aubio_fft_t = _aubio_fft_t;
1149extern "C" {
1150 #[doc = " create new FFT computation object"]
1151 #[doc = ""]
1152 #[doc = "\\param size length of the FFT"]
1153 pub fn new_aubio_fft(size: uint_t) -> *mut aubio_fft_t;
1154}
1155extern "C" {
1156 #[doc = " delete FFT object"]
1157 #[doc = ""]
1158 #[doc = "\\param s fft object as returned by new_aubio_fft"]
1159 pub fn del_aubio_fft(s: *mut aubio_fft_t);
1160}
1161extern "C" {
1162 #[doc = " compute forward FFT"]
1163 #[doc = ""]
1164 #[doc = "\\param s fft object as returned by new_aubio_fft"]
1165 #[doc = "\\param input input signal"]
1166 #[doc = "\\param spectrum output spectrum"]
1167 pub fn aubio_fft_do(s: *mut aubio_fft_t, input: *const fvec_t, spectrum: *mut cvec_t);
1168}
1169extern "C" {
1170 #[doc = " compute backward (inverse) FFT"]
1171 #[doc = ""]
1172 #[doc = "\\param s fft object as returned by new_aubio_fft"]
1173 #[doc = "\\param spectrum input spectrum"]
1174 #[doc = "\\param output output signal"]
1175 pub fn aubio_fft_rdo(s: *mut aubio_fft_t, spectrum: *const cvec_t, output: *mut fvec_t);
1176}
1177extern "C" {
1178 #[doc = " compute forward FFT"]
1179 #[doc = ""]
1180 #[doc = "\\param s fft object as returned by new_aubio_fft"]
1181 #[doc = "\\param input real input signal"]
1182 #[doc = "\\param compspec complex output fft real/imag"]
1183 pub fn aubio_fft_do_complex(s: *mut aubio_fft_t, input: *const fvec_t, compspec: *mut fvec_t);
1184}
1185extern "C" {
1186 #[doc = " compute backward (inverse) FFT from real/imag"]
1187 #[doc = ""]
1188 #[doc = "\\param s fft object as returned by new_aubio_fft"]
1189 #[doc = "\\param compspec real/imag input fft array"]
1190 #[doc = "\\param output real output array"]
1191 pub fn aubio_fft_rdo_complex(s: *mut aubio_fft_t, compspec: *const fvec_t, output: *mut fvec_t);
1192}
1193extern "C" {
1194 #[doc = " convert real/imag spectrum to norm/phas spectrum"]
1195 #[doc = ""]
1196 #[doc = "\\param compspec real/imag input fft array"]
1197 #[doc = "\\param spectrum cvec norm/phas output array"]
1198 pub fn aubio_fft_get_spectrum(compspec: *const fvec_t, spectrum: *mut cvec_t);
1199}
1200extern "C" {
1201 #[doc = " convert real/imag spectrum to norm/phas spectrum"]
1202 #[doc = ""]
1203 #[doc = "\\param compspec real/imag input fft array"]
1204 #[doc = "\\param spectrum cvec norm/phas output array"]
1205 pub fn aubio_fft_get_realimag(spectrum: *const cvec_t, compspec: *mut fvec_t);
1206}
1207extern "C" {
1208 #[doc = " compute phas spectrum from real/imag parts"]
1209 #[doc = ""]
1210 #[doc = "\\param compspec real/imag input fft array"]
1211 #[doc = "\\param spectrum cvec norm/phas output array"]
1212 pub fn aubio_fft_get_phas(compspec: *const fvec_t, spectrum: *mut cvec_t);
1213}
1214extern "C" {
1215 #[doc = " compute imaginary part from the norm/phas cvec"]
1216 #[doc = ""]
1217 #[doc = "\\param spectrum norm/phas input array"]
1218 #[doc = "\\param compspec real/imag output fft array"]
1219 pub fn aubio_fft_get_imag(spectrum: *const cvec_t, compspec: *mut fvec_t);
1220}
1221extern "C" {
1222 #[doc = " compute norm component from real/imag parts"]
1223 #[doc = ""]
1224 #[doc = "\\param compspec real/imag input fft array"]
1225 #[doc = "\\param spectrum cvec norm/phas output array"]
1226 pub fn aubio_fft_get_norm(compspec: *const fvec_t, spectrum: *mut cvec_t);
1227}
1228extern "C" {
1229 #[doc = " compute real part from norm/phas components"]
1230 #[doc = ""]
1231 #[doc = "\\param spectrum norm/phas input array"]
1232 #[doc = "\\param compspec real/imag output fft array"]
1233 pub fn aubio_fft_get_real(spectrum: *const cvec_t, compspec: *mut fvec_t);
1234}
1235#[repr(C)]
1236#[derive(Debug, Copy, Clone)]
1237pub struct _aubio_dct_t {
1238 _unused: [u8; 0],
1239}
1240#[doc = " DCT object"]
1241#[doc = ""]
1242#[doc = "This object computes forward and backward DCT type 2 with orthonormal"]
1243#[doc = "scaling."]
1244pub type aubio_dct_t = _aubio_dct_t;
1245extern "C" {
1246 #[doc = " create new DCT computation object"]
1247 #[doc = ""]
1248 #[doc = "\\param size length of the DCT"]
1249 pub fn new_aubio_dct(size: uint_t) -> *mut aubio_dct_t;
1250}
1251extern "C" {
1252 #[doc = " compute forward DCT"]
1253 #[doc = ""]
1254 #[doc = "\\param s dct object as returned by new_aubio_dct"]
1255 #[doc = "\\param input input signal"]
1256 #[doc = "\\param dct_output transformed input array"]
1257 pub fn aubio_dct_do(s: *mut aubio_dct_t, input: *const fvec_t, dct_output: *mut fvec_t);
1258}
1259extern "C" {
1260 #[doc = " compute backward DCT"]
1261 #[doc = ""]
1262 #[doc = "\\param s dct object as returned by new_aubio_dct"]
1263 #[doc = "\\param input input signal"]
1264 #[doc = "\\param idct_output transformed input array"]
1265 pub fn aubio_dct_rdo(s: *mut aubio_dct_t, input: *const fvec_t, idct_output: *mut fvec_t);
1266}
1267extern "C" {
1268 #[doc = " delete DCT object"]
1269 #[doc = ""]
1270 #[doc = "\\param s dct object as returned by new_aubio_dct"]
1271 pub fn del_aubio_dct(s: *mut aubio_dct_t);
1272}
1273#[repr(C)]
1274#[derive(Debug, Copy, Clone)]
1275pub struct _aubio_pvoc_t {
1276 _unused: [u8; 0],
1277}
1278#[doc = " phasevocoder object"]
1279pub type aubio_pvoc_t = _aubio_pvoc_t;
1280extern "C" {
1281 #[doc = " create phase vocoder object"]
1282 #[doc = ""]
1283 #[doc = "\\param win_s size of analysis buffer (and length the FFT transform)"]
1284 #[doc = "\\param hop_s step size between two consecutive analysis"]
1285 pub fn new_aubio_pvoc(win_s: uint_t, hop_s: uint_t) -> *mut aubio_pvoc_t;
1286}
1287extern "C" {
1288 #[doc = " delete phase vocoder object"]
1289 #[doc = ""]
1290 #[doc = "\\param pv phase vocoder object as returned by new_aubio_pvoc"]
1291 pub fn del_aubio_pvoc(pv: *mut aubio_pvoc_t);
1292}
1293extern "C" {
1294 #[doc = " compute spectral frame"]
1295 #[doc = ""]
1296 #[doc = "This function accepts an input vector of size [hop_s]. The"]
1297 #[doc = "analysis buffer is rotated and filled with the new data. After windowing of"]
1298 #[doc = "this signal window, the Fourier transform is computed and returned in"]
1299 #[doc = "fftgrain as two vectors, magnitude and phase."]
1300 #[doc = ""]
1301 #[doc = "\\param pv phase vocoder object as returned by new_aubio_pvoc"]
1302 #[doc = "\\param in new input signal (hop_s long)"]
1303 #[doc = "\\param fftgrain output spectral frame"]
1304 pub fn aubio_pvoc_do(pv: *mut aubio_pvoc_t, in_: *const fvec_t, fftgrain: *mut cvec_t);
1305}
1306extern "C" {
1307 #[doc = " compute signal from spectral frame"]
1308 #[doc = ""]
1309 #[doc = "This function takes an input spectral frame fftgrain of size"]
1310 #[doc = "[buf_s] and computes its inverse Fourier transform. Overlap-add"]
1311 #[doc = "synthesis is then computed using the previously synthetised frames, and the"]
1312 #[doc = "output stored in out."]
1313 #[doc = ""]
1314 #[doc = "\\param pv phase vocoder object as returned by new_aubio_pvoc"]
1315 #[doc = "\\param fftgrain input spectral frame"]
1316 #[doc = "\\param out output signal (hop_s long)"]
1317 pub fn aubio_pvoc_rdo(pv: *mut aubio_pvoc_t, fftgrain: *mut cvec_t, out: *mut fvec_t);
1318}
1319extern "C" {
1320 #[doc = " get window size"]
1321 #[doc = ""]
1322 #[doc = "\\param pv phase vocoder to get the window size from"]
1323 pub fn aubio_pvoc_get_win(pv: *mut aubio_pvoc_t) -> uint_t;
1324}
1325extern "C" {
1326 #[doc = " get hop size"]
1327 #[doc = ""]
1328 #[doc = "\\param pv phase vocoder to get the hop size from"]
1329 pub fn aubio_pvoc_get_hop(pv: *mut aubio_pvoc_t) -> uint_t;
1330}
1331extern "C" {
1332 #[doc = " set window type"]
1333 #[doc = ""]
1334 #[doc = "\\param pv phase vocoder to set the window type"]
1335 #[doc = "\\param window_type a string representing a window"]
1336 #[doc = ""]
1337 #[doc = "\\return 0 if successful, non-zero otherwise"]
1338 #[doc = ""]
1339 pub fn aubio_pvoc_set_window(pv: *mut aubio_pvoc_t, window_type: *const char_t) -> uint_t;
1340}
1341#[repr(C)]
1342#[derive(Debug, Copy, Clone)]
1343pub struct _aubio_filterbank_t {
1344 _unused: [u8; 0],
1345}
1346#[doc = " filterbank object"]
1347#[doc = ""]
1348#[doc = "This object stores a matrix of spectral filter coefficients."]
1349#[doc = ""]
1350pub type aubio_filterbank_t = _aubio_filterbank_t;
1351extern "C" {
1352 #[doc = " create filterbank object"]
1353 #[doc = ""]
1354 #[doc = "\\param n_filters number of filters to create"]
1355 #[doc = "\\param win_s size of analysis buffer (and length the FFT transform)"]
1356 pub fn new_aubio_filterbank(n_filters: uint_t, win_s: uint_t) -> *mut aubio_filterbank_t;
1357}
1358extern "C" {
1359 #[doc = " destroy filterbank object"]
1360 #[doc = ""]
1361 #[doc = "\\param f filterbank object, as returned by new_aubio_filterbank()"]
1362 pub fn del_aubio_filterbank(f: *mut aubio_filterbank_t);
1363}
1364extern "C" {
1365 #[doc = " compute filterbank"]
1366 #[doc = ""]
1367 #[doc = "\\param f filterbank object, as returned by new_aubio_filterbank()"]
1368 #[doc = "\\param in input spectrum containing an input spectrum of length `win_s`"]
1369 #[doc = "\\param out output vector containing the energy found in each band, `nfilt` output values"]
1370 pub fn aubio_filterbank_do(f: *mut aubio_filterbank_t, in_: *const cvec_t, out: *mut fvec_t);
1371}
1372extern "C" {
1373 #[doc = " return a pointer to the matrix object containing all filter coefficients"]
1374 #[doc = ""]
1375 #[doc = "\\param f filterbank object, as returned by new_aubio_filterbank()"]
1376 #[doc = ""]
1377 pub fn aubio_filterbank_get_coeffs(f: *const aubio_filterbank_t) -> *mut fmat_t;
1378}
1379extern "C" {
1380 #[doc = " copy filter coefficients to the filterbank"]
1381 #[doc = ""]
1382 #[doc = "\\param f filterbank object, as returned by new_aubio_filterbank()"]
1383 #[doc = "\\param filters filter bank coefficients to copy from"]
1384 #[doc = ""]
1385 pub fn aubio_filterbank_set_coeffs(
1386 f: *mut aubio_filterbank_t,
1387 filters: *const fmat_t,
1388 ) -> uint_t;
1389}
1390extern "C" {
1391 #[doc = " set norm parameter"]
1392 #[doc = ""]
1393 #[doc = "\\param f filterbank object, as returned by new_aubio_filterbank()"]
1394 #[doc = "\\param norm `1` to norm the filters, `0` otherwise."]
1395 #[doc = ""]
1396 #[doc = "If set to `0`, the filters will not be normalized. If set to `1`,"]
1397 #[doc = "each filter will be normalized to one. Defaults to `1`."]
1398 #[doc = ""]
1399 #[doc = "This function should be called *before* setting the filters with one of"]
1400 #[doc = "aubio_filterbank_set_triangle_bands(), aubio_filterbank_set_mel_coeffs(),"]
1401 #[doc = "aubio_filterbank_set_mel_coeffs_htk(), or"]
1402 #[doc = "aubio_filterbank_set_mel_coeffs_slaney()."]
1403 #[doc = ""]
1404 pub fn aubio_filterbank_set_norm(f: *mut aubio_filterbank_t, norm: smpl_t) -> uint_t;
1405}
1406extern "C" {
1407 #[doc = " get norm parameter"]
1408 #[doc = ""]
1409 #[doc = "\\param f filterbank object, as returned by new_aubio_filterbank()"]
1410 #[doc = "\\returns `1` if norm is set, `0` otherwise. Defaults to `1`."]
1411 #[doc = ""]
1412 pub fn aubio_filterbank_get_norm(f: *mut aubio_filterbank_t) -> smpl_t;
1413}
1414extern "C" {
1415 #[doc = " set power parameter"]
1416 #[doc = ""]
1417 #[doc = "\\param f filterbank object, as returned by new_aubio_filterbank()"]
1418 #[doc = "\\param power Raise norm of the input spectrum norm to this power before"]
1419 #[doc = "computing filterbank. Defaults to `1`."]
1420 #[doc = ""]
1421 pub fn aubio_filterbank_set_power(f: *mut aubio_filterbank_t, power: smpl_t) -> uint_t;
1422}
1423extern "C" {
1424 #[doc = " get power parameter"]
1425 #[doc = ""]
1426 #[doc = "\\param f filterbank object, as returned by new_aubio_filterbank()"]
1427 #[doc = "\\return current power parameter. Defaults to `1`."]
1428 #[doc = ""]
1429 pub fn aubio_filterbank_get_power(f: *mut aubio_filterbank_t) -> smpl_t;
1430}
1431extern "C" {
1432 #[doc = " filterbank initialization with triangular and overlapping bands"]
1433 #[doc = ""]
1434 #[doc = "\\param fb filterbank object"]
1435 #[doc = "\\param freqs arbitrary array of boundary frequencies"]
1436 #[doc = "\\param samplerate audio sampling rate"]
1437 #[doc = ""]
1438 #[doc = "This function computes the coefficients of the filterbank based on the"]
1439 #[doc = "boundaries found in freqs, in Hz, and using triangular overlapping bands."]
1440 pub fn aubio_filterbank_set_triangle_bands(
1441 fb: *mut aubio_filterbank_t,
1442 freqs: *const fvec_t,
1443 samplerate: smpl_t,
1444 ) -> uint_t;
1445}
1446extern "C" {
1447 #[doc = " filterbank initialization for Mel filters using Slaney's coefficients"]
1448 #[doc = ""]
1449 #[doc = "\\param fb filterbank object"]
1450 #[doc = "\\param samplerate audio sampling rate, in Hz"]
1451 #[doc = ""]
1452 #[doc = "The filter coefficients are built to match exactly Malcolm Slaney's Auditory"]
1453 #[doc = "Toolbox implementation (see file mfcc.m). The number of filters should be 40."]
1454 #[doc = ""]
1455 #[doc = "References"]
1456 #[doc = "----------"]
1457 #[doc = ""]
1458 #[doc = "Malcolm Slaney, *Auditory Toolbox Version 2, Technical Report #1998-010*"]
1459 #[doc = "https://engineering.purdue.edu/~malcolm/interval/1998-010/"]
1460 pub fn aubio_filterbank_set_mel_coeffs_slaney(
1461 fb: *mut aubio_filterbank_t,
1462 samplerate: smpl_t,
1463 ) -> uint_t;
1464}
1465extern "C" {
1466 #[doc = " Mel filterbank initialization"]
1467 #[doc = ""]
1468 #[doc = "\\param fb filterbank object"]
1469 #[doc = "\\param samplerate audio sampling rate"]
1470 #[doc = "\\param fmin start frequency, in Hz"]
1471 #[doc = "\\param fmax end frequency, in Hz"]
1472 #[doc = ""]
1473 #[doc = "The filterbank will be initialized with bands linearly spaced in the mel"]
1474 #[doc = "scale, from `fmin` to `fmax`."]
1475 #[doc = ""]
1476 #[doc = "References"]
1477 #[doc = "----------"]
1478 #[doc = ""]
1479 #[doc = "Malcolm Slaney, *Auditory Toolbox Version 2, Technical Report #1998-010*"]
1480 #[doc = "https://engineering.purdue.edu/~malcolm/interval/1998-010/"]
1481 pub fn aubio_filterbank_set_mel_coeffs(
1482 fb: *mut aubio_filterbank_t,
1483 samplerate: smpl_t,
1484 fmin: smpl_t,
1485 fmax: smpl_t,
1486 ) -> uint_t;
1487}
1488extern "C" {
1489 #[doc = " Mel filterbank initialization"]
1490 #[doc = ""]
1491 #[doc = "\\param fb filterbank object"]
1492 #[doc = "\\param samplerate audio sampling rate"]
1493 #[doc = "\\param fmin start frequency, in Hz"]
1494 #[doc = "\\param fmax end frequency, in Hz"]
1495 #[doc = ""]
1496 #[doc = "The bank of filters will be initalized to to cover linearly spaced bands in"]
1497 #[doc = "the Htk mel scale, from `fmin` to `fmax`."]
1498 #[doc = ""]
1499 #[doc = "References"]
1500 #[doc = "----------"]
1501 #[doc = ""]
1502 #[doc = "Douglas O'Shaughnessy (1987). *Speech communication: human and machine*."]
1503 #[doc = "Addison-Wesley. p. 150. ISBN 978-0-201-16520-3."]
1504 #[doc = ""]
1505 #[doc = "HTK Speech Recognition Toolkit: http://htk.eng.cam.ac.uk/"]
1506 pub fn aubio_filterbank_set_mel_coeffs_htk(
1507 fb: *mut aubio_filterbank_t,
1508 samplerate: smpl_t,
1509 fmin: smpl_t,
1510 fmax: smpl_t,
1511 ) -> uint_t;
1512}
1513#[repr(C)]
1514#[derive(Debug, Copy, Clone)]
1515pub struct _aubio_mfcc_t {
1516 _unused: [u8; 0],
1517}
1518#[doc = " mfcc object"]
1519pub type aubio_mfcc_t = _aubio_mfcc_t;
1520extern "C" {
1521 #[doc = " create mfcc object"]
1522 #[doc = ""]
1523 #[doc = "\\param buf_size size of analysis buffer (and length the FFT transform)"]
1524 #[doc = "\\param samplerate audio sampling rate"]
1525 #[doc = "\\param n_coeffs number of desired coefficients"]
1526 #[doc = "\\param n_filters number of desired filters"]
1527 pub fn new_aubio_mfcc(
1528 buf_size: uint_t,
1529 n_filters: uint_t,
1530 n_coeffs: uint_t,
1531 samplerate: uint_t,
1532 ) -> *mut aubio_mfcc_t;
1533}
1534extern "C" {
1535 #[doc = " delete mfcc object"]
1536 #[doc = ""]
1537 #[doc = "\\param mf mfcc object as returned by new_aubio_mfcc"]
1538 pub fn del_aubio_mfcc(mf: *mut aubio_mfcc_t);
1539}
1540extern "C" {
1541 #[doc = " mfcc object processing"]
1542 #[doc = ""]
1543 #[doc = "\\param mf mfcc object as returned by new_aubio_mfcc"]
1544 #[doc = "\\param in input spectrum (buf_size long)"]
1545 #[doc = "\\param out output mel coefficients buffer (n_coeffs long)"]
1546 pub fn aubio_mfcc_do(mf: *mut aubio_mfcc_t, in_: *const cvec_t, out: *mut fvec_t);
1547}
1548extern "C" {
1549 #[doc = " set power parameter"]
1550 #[doc = ""]
1551 #[doc = "\\param mf mfcc object, as returned by new_aubio_mfcc()"]
1552 #[doc = "\\param power Raise norm of the input spectrum norm to this power before"]
1553 #[doc = "computing filterbank. Defaults to `1`."]
1554 #[doc = ""]
1555 #[doc = "See aubio_filterbank_set_power()."]
1556 #[doc = ""]
1557 pub fn aubio_mfcc_set_power(mf: *mut aubio_mfcc_t, power: smpl_t) -> uint_t;
1558}
1559extern "C" {
1560 #[doc = " get power parameter"]
1561 #[doc = ""]
1562 #[doc = "\\param mf mfcc object, as returned by new_aubio_mfcc()"]
1563 #[doc = "\\return current power parameter. Defaults to `1`."]
1564 #[doc = ""]
1565 #[doc = "See aubio_filterbank_get_power()."]
1566 #[doc = ""]
1567 pub fn aubio_mfcc_get_power(mf: *mut aubio_mfcc_t) -> smpl_t;
1568}
1569extern "C" {
1570 #[doc = " set scaling parameter"]
1571 #[doc = ""]
1572 #[doc = "\\param mf mfcc object, as returned by new_aubio_mfcc()"]
1573 #[doc = "\\param scale Scaling value to apply."]
1574 #[doc = ""]
1575 #[doc = "Scales the output of the filterbank after taking its logarithm and before"]
1576 #[doc = "computing the DCT. Defaults to `1`."]
1577 pub fn aubio_mfcc_set_scale(mf: *mut aubio_mfcc_t, scale: smpl_t) -> uint_t;
1578}
1579extern "C" {
1580 #[doc = " get scaling parameter"]
1581 #[doc = ""]
1582 #[doc = "\\param mf mfcc object, as returned by new_aubio_mfcc()"]
1583 #[doc = "\\return current scaling parameter. Defaults to `1`."]
1584 #[doc = ""]
1585 pub fn aubio_mfcc_get_scale(mf: *mut aubio_mfcc_t) -> smpl_t;
1586}
1587extern "C" {
1588 #[doc = " Mel filterbank initialization"]
1589 #[doc = ""]
1590 #[doc = "\\param mf mfcc object"]
1591 #[doc = "\\param fmin start frequency, in Hz"]
1592 #[doc = "\\param fmax end frequency, in Hz"]
1593 #[doc = ""]
1594 #[doc = "The filterbank will be initialized with bands linearly spaced in the mel"]
1595 #[doc = "scale, from `fmin` to `fmax`."]
1596 #[doc = ""]
1597 #[doc = "See also"]
1598 #[doc = "--------"]
1599 #[doc = ""]
1600 #[doc = "aubio_filterbank_set_mel_coeffs()"]
1601 pub fn aubio_mfcc_set_mel_coeffs(mf: *mut aubio_mfcc_t, fmin: smpl_t, fmax: smpl_t) -> uint_t;
1602}
1603extern "C" {
1604 #[doc = " Mel filterbank initialization"]
1605 #[doc = ""]
1606 #[doc = "\\param mf mfcc object"]
1607 #[doc = "\\param fmin start frequency, in Hz"]
1608 #[doc = "\\param fmax end frequency, in Hz"]
1609 #[doc = ""]
1610 #[doc = "The bank of filters will be initalized to to cover linearly spaced bands in"]
1611 #[doc = "the Htk mel scale, from `fmin` to `fmax`."]
1612 #[doc = ""]
1613 #[doc = "See also"]
1614 #[doc = "--------"]
1615 #[doc = ""]
1616 #[doc = "aubio_filterbank_set_mel_coeffs_htk()"]
1617 pub fn aubio_mfcc_set_mel_coeffs_htk(
1618 mf: *mut aubio_mfcc_t,
1619 fmin: smpl_t,
1620 fmax: smpl_t,
1621 ) -> uint_t;
1622}
1623extern "C" {
1624 #[doc = " Mel filterbank initialization (Auditory Toolbox's parameters)"]
1625 #[doc = ""]
1626 #[doc = "\\param mf mfcc object"]
1627 #[doc = ""]
1628 #[doc = "The filter coefficients are built to match exactly Malcolm Slaney's Auditory"]
1629 #[doc = "Toolbox implementation. The number of filters should be 40."]
1630 #[doc = ""]
1631 #[doc = "This is the default filterbank when `mf` was created with `n_filters = 40`."]
1632 #[doc = ""]
1633 #[doc = "See also"]
1634 #[doc = "--------"]
1635 #[doc = ""]
1636 #[doc = "aubio_filterbank_set_mel_coeffs_slaney()"]
1637 pub fn aubio_mfcc_set_mel_coeffs_slaney(mf: *mut aubio_mfcc_t) -> uint_t;
1638}
1639#[repr(C)]
1640#[derive(Debug, Copy, Clone)]
1641pub struct _aubio_specdesc_t {
1642 _unused: [u8; 0],
1643}
1644#[doc = " spectral description structure"]
1645pub type aubio_specdesc_t = _aubio_specdesc_t;
1646extern "C" {
1647 #[doc = " execute spectral description function on a spectral frame"]
1648 #[doc = ""]
1649 #[doc = "Generic function to compute spectral description."]
1650 #[doc = ""]
1651 #[doc = "\\param o spectral description object as returned by new_aubio_specdesc()"]
1652 #[doc = "\\param fftgrain input signal spectrum as computed by aubio_pvoc_do"]
1653 #[doc = "\\param desc output vector (one sample long, to send to the peak picking)"]
1654 pub fn aubio_specdesc_do(o: *mut aubio_specdesc_t, fftgrain: *const cvec_t, desc: *mut fvec_t);
1655}
1656extern "C" {
1657 #[doc = " creation of a spectral description object"]
1658 #[doc = ""]
1659 #[doc = "\\param method spectral description method"]
1660 #[doc = "\\param buf_size length of the input spectrum frame"]
1661 #[doc = ""]
1662 #[doc = "The parameter \\p method is a string that can be any of:"]
1663 #[doc = ""]
1664 #[doc = "- onset novelty functions: `complex`, `energy`, `hfc`, `kl`, `mkl`,"]
1665 #[doc = "`phase`, `specdiff`, `specflux`, `wphase`,"]
1666 #[doc = ""]
1667 #[doc = "- spectral descriptors: `centroid`, `decrease`, `kurtosis`, `rolloff`,"]
1668 #[doc = "`skewness`, `slope`, `spread`."]
1669 pub fn new_aubio_specdesc(method: *const char_t, buf_size: uint_t) -> *mut aubio_specdesc_t;
1670}
1671extern "C" {
1672 #[doc = " deletion of a spectral descriptor"]
1673 #[doc = ""]
1674 #[doc = "\\param o spectral descriptor object as returned by new_aubio_specdesc()"]
1675 pub fn del_aubio_specdesc(o: *mut aubio_specdesc_t);
1676}
1677#[repr(C)]
1678#[derive(Debug, Copy, Clone)]
1679pub struct _aubio_spectral_whitening_t {
1680 _unused: [u8; 0],
1681}
1682#[doc = " spectral whitening structure"]
1683pub type aubio_spectral_whitening_t = _aubio_spectral_whitening_t;
1684extern "C" {
1685 #[doc = " execute spectral adaptive whitening, in-place"]
1686 #[doc = ""]
1687 #[doc = "\\param o spectral whitening object as returned by new_aubio_spectral_whitening()"]
1688 #[doc = "\\param fftgrain input signal spectrum as computed by aubio_pvoc_do() or aubio_fft_do()"]
1689 pub fn aubio_spectral_whitening_do(o: *mut aubio_spectral_whitening_t, fftgrain: *mut cvec_t);
1690}
1691extern "C" {
1692 #[doc = " creation of a spectral whitening object"]
1693 #[doc = ""]
1694 #[doc = "\\param buf_size window size of input grains"]
1695 #[doc = "\\param hop_size number of samples between two consecutive input grains"]
1696 #[doc = "\\param samplerate sampling rate of the input signal"]
1697 pub fn new_aubio_spectral_whitening(
1698 buf_size: uint_t,
1699 hop_size: uint_t,
1700 samplerate: uint_t,
1701 ) -> *mut aubio_spectral_whitening_t;
1702}
1703extern "C" {
1704 #[doc = " reset spectral whitening object"]
1705 #[doc = ""]
1706 #[doc = "\\param o spectral whitening object as returned by new_aubio_spectral_whitening()"]
1707 #[doc = ""]
1708 pub fn aubio_spectral_whitening_reset(o: *mut aubio_spectral_whitening_t);
1709}
1710extern "C" {
1711 #[doc = " set relaxation time for spectral whitening"]
1712 #[doc = ""]
1713 #[doc = "\\param o spectral whitening object as returned by new_aubio_spectral_whitening()"]
1714 #[doc = "\\param relax_time relaxation time in seconds between 20 and 500, defaults 250"]
1715 #[doc = ""]
1716 pub fn aubio_spectral_whitening_set_relax_time(
1717 o: *mut aubio_spectral_whitening_t,
1718 relax_time: smpl_t,
1719 ) -> uint_t;
1720}
1721extern "C" {
1722 #[doc = " get relaxation time of spectral whitening"]
1723 #[doc = ""]
1724 #[doc = "\\param o spectral whitening object as returned by new_aubio_spectral_whitening()"]
1725 #[doc = "\\return relaxation time in seconds"]
1726 pub fn aubio_spectral_whitening_get_relax_time(o: *mut aubio_spectral_whitening_t) -> smpl_t;
1727}
1728extern "C" {
1729 #[doc = " set floor for spectral whitening"]
1730 #[doc = ""]
1731 #[doc = "\\param o spectral whitening object as returned by new_aubio_spectral_whitening()"]
1732 #[doc = "\\param floor value (typically between 1.e-6 and .2, defaults to 1.e-4)"]
1733 #[doc = ""]
1734 pub fn aubio_spectral_whitening_set_floor(
1735 o: *mut aubio_spectral_whitening_t,
1736 floor: smpl_t,
1737 ) -> uint_t;
1738}
1739extern "C" {
1740 #[doc = " get floor of spectral whitening"]
1741 #[doc = ""]
1742 #[doc = "\\param o spectral whitening object as returned by new_aubio_spectral_whitening()"]
1743 #[doc = "\\return floor value"]
1744 pub fn aubio_spectral_whitening_get_floor(o: *mut aubio_spectral_whitening_t) -> smpl_t;
1745}
1746extern "C" {
1747 #[doc = " deletion of a spectral whitening"]
1748 #[doc = ""]
1749 #[doc = "\\param o spectral whitening object as returned by new_aubio_spectral_whitening()"]
1750 pub fn del_aubio_spectral_whitening(o: *mut aubio_spectral_whitening_t);
1751}
1752#[repr(C)]
1753#[derive(Debug, Copy, Clone)]
1754pub struct _aubio_tss_t {
1755 _unused: [u8; 0],
1756}
1757#[doc = " Transient / Steady-state Separation object"]
1758pub type aubio_tss_t = _aubio_tss_t;
1759extern "C" {
1760 #[doc = " create tss object"]
1761 #[doc = ""]
1762 #[doc = "\\param buf_size buffer size"]
1763 #[doc = "\\param hop_size step size"]
1764 pub fn new_aubio_tss(buf_size: uint_t, hop_size: uint_t) -> *mut aubio_tss_t;
1765}
1766extern "C" {
1767 #[doc = " delete tss object"]
1768 #[doc = ""]
1769 #[doc = "\\param o tss object as returned by new_aubio_tss()"]
1770 pub fn del_aubio_tss(o: *mut aubio_tss_t);
1771}
1772extern "C" {
1773 #[doc = " split input into transient and steady states components"]
1774 #[doc = ""]
1775 #[doc = "\\param o tss object as returned by new_aubio_tss()"]
1776 #[doc = "\\param input input spectral frame"]
1777 #[doc = "\\param trans output transient components"]
1778 #[doc = "\\param stead output steady state components"]
1779 pub fn aubio_tss_do(
1780 o: *mut aubio_tss_t,
1781 input: *const cvec_t,
1782 trans: *mut cvec_t,
1783 stead: *mut cvec_t,
1784 );
1785}
1786extern "C" {
1787 #[doc = " set transient / steady state separation threshold"]
1788 #[doc = ""]
1789 #[doc = "\\param o tss object as returned by new_aubio_tss()"]
1790 #[doc = "\\param thrs new threshold value"]
1791 pub fn aubio_tss_set_threshold(o: *mut aubio_tss_t, thrs: smpl_t) -> uint_t;
1792}
1793extern "C" {
1794 #[doc = " set parameter a, defaults to 3"]
1795 #[doc = ""]
1796 #[doc = "\\param o tss object as returned by new_aubio_tss()"]
1797 #[doc = "\\param alpha new value for alpha parameter"]
1798 pub fn aubio_tss_set_alpha(o: *mut aubio_tss_t, alpha: smpl_t) -> uint_t;
1799}
1800extern "C" {
1801 #[doc = " set parameter b, defaults to 3"]
1802 #[doc = ""]
1803 #[doc = "\\param o tss object as returned by new_aubio_tss()"]
1804 #[doc = "\\param beta new value for beta parameter"]
1805 pub fn aubio_tss_set_beta(o: *mut aubio_tss_t, beta: smpl_t) -> uint_t;
1806}
1807#[repr(C)]
1808#[derive(Debug, Copy, Clone)]
1809pub struct _aubio_pitch_t {
1810 _unused: [u8; 0],
1811}
1812#[doc = " pitch detection object"]
1813pub type aubio_pitch_t = _aubio_pitch_t;
1814extern "C" {
1815 #[doc = " execute pitch detection on an input signal frame"]
1816 #[doc = ""]
1817 #[doc = "\\param o pitch detection object as returned by new_aubio_pitch()"]
1818 #[doc = "\\param in input signal of size [hop_size]"]
1819 #[doc = "\\param out output pitch candidates of size [1]"]
1820 pub fn aubio_pitch_do(o: *mut aubio_pitch_t, in_: *const fvec_t, out: *mut fvec_t);
1821}
1822extern "C" {
1823 #[doc = " change yin or yinfft tolerance threshold"]
1824 #[doc = ""]
1825 #[doc = "\\param o pitch detection object as returned by new_aubio_pitch()"]
1826 #[doc = "\\param tol tolerance default is 0.15 for yin and 0.85 for yinfft"]
1827 pub fn aubio_pitch_set_tolerance(o: *mut aubio_pitch_t, tol: smpl_t) -> uint_t;
1828}
1829extern "C" {
1830 #[doc = " get yin or yinfft tolerance threshold"]
1831 #[doc = ""]
1832 #[doc = "\\param o pitch detection object as returned by new_aubio_pitch()"]
1833 #[doc = "\\return tolerance (default is 0.15 for yin and 0.85 for yinfft)"]
1834 pub fn aubio_pitch_get_tolerance(o: *mut aubio_pitch_t) -> smpl_t;
1835}
1836extern "C" {
1837 #[doc = " deletion of the pitch detection object"]
1838 #[doc = ""]
1839 #[doc = "\\param o pitch detection object as returned by new_aubio_pitch()"]
1840 pub fn del_aubio_pitch(o: *mut aubio_pitch_t);
1841}
1842extern "C" {
1843 #[doc = " creation of the pitch detection object"]
1844 #[doc = ""]
1845 #[doc = "\\param method set pitch detection algorithm"]
1846 #[doc = "\\param buf_size size of the input buffer to analyse"]
1847 #[doc = "\\param hop_size step size between two consecutive analysis instant"]
1848 #[doc = "\\param samplerate sampling rate of the signal"]
1849 #[doc = ""]
1850 #[doc = "\\return newly created ::aubio_pitch_t"]
1851 pub fn new_aubio_pitch(
1852 method: *const char_t,
1853 buf_size: uint_t,
1854 hop_size: uint_t,
1855 samplerate: uint_t,
1856 ) -> *mut aubio_pitch_t;
1857}
1858extern "C" {
1859 #[doc = " set the output unit of the pitch detection object"]
1860 #[doc = ""]
1861 #[doc = "\\param o pitch detection object as returned by new_aubio_pitch()"]
1862 #[doc = "\\param mode set pitch units for output"]
1863 #[doc = ""]
1864 #[doc = "mode can be one of \"Hz\", \"midi\", \"cent\", or \"bin\". Defaults to \"Hz\"."]
1865 #[doc = ""]
1866 #[doc = "\\return 0 if successfull, non-zero otherwise"]
1867 pub fn aubio_pitch_set_unit(o: *mut aubio_pitch_t, mode: *const char_t) -> uint_t;
1868}
1869extern "C" {
1870 #[doc = " set the silence threshold of the pitch detection object"]
1871 #[doc = ""]
1872 #[doc = "\\param o pitch detection object as returned by new_aubio_pitch()"]
1873 #[doc = "\\param silence level threshold under which pitch should be ignored, in dB"]
1874 #[doc = ""]
1875 #[doc = "\\return 0 if successfull, non-zero otherwise"]
1876 pub fn aubio_pitch_set_silence(o: *mut aubio_pitch_t, silence: smpl_t) -> uint_t;
1877}
1878extern "C" {
1879 #[doc = " set the silence threshold of the pitch detection object"]
1880 #[doc = ""]
1881 #[doc = "\\param o pitch detection object as returned by ::new_aubio_pitch()"]
1882 #[doc = ""]
1883 #[doc = "\\return level threshold under which pitch should be ignored, in dB"]
1884 pub fn aubio_pitch_get_silence(o: *mut aubio_pitch_t) -> smpl_t;
1885}
1886extern "C" {
1887 #[doc = " get the current confidence"]
1888 #[doc = ""]
1889 #[doc = "\\param o pitch detection object as returned by new_aubio_pitch()"]
1890 #[doc = ""]
1891 #[doc = "\\return the current confidence of the pitch algorithm"]
1892 pub fn aubio_pitch_get_confidence(o: *mut aubio_pitch_t) -> smpl_t;
1893}
1894#[repr(C)]
1895#[derive(Debug, Copy, Clone)]
1896pub struct _aubio_onset_t {
1897 _unused: [u8; 0],
1898}
1899#[doc = " onset detection object"]
1900pub type aubio_onset_t = _aubio_onset_t;
1901extern "C" {
1902 #[doc = " create onset detection object"]
1903 #[doc = ""]
1904 #[doc = "\\param method onset detection type as specified in specdesc.h"]
1905 #[doc = "\\param buf_size buffer size for phase vocoder"]
1906 #[doc = "\\param hop_size hop size for phase vocoder"]
1907 #[doc = "\\param samplerate sampling rate of the input signal"]
1908 #[doc = ""]
1909 #[doc = "\\return newly created ::aubio_onset_t"]
1910 pub fn new_aubio_onset(
1911 method: *const char_t,
1912 buf_size: uint_t,
1913 hop_size: uint_t,
1914 samplerate: uint_t,
1915 ) -> *mut aubio_onset_t;
1916}
1917extern "C" {
1918 #[doc = " execute onset detection"]
1919 #[doc = ""]
1920 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
1921 #[doc = "\\param input new audio vector of length hop_size"]
1922 #[doc = "\\param onset output vector of length 1, containing 0 if no onset was found,"]
1923 #[doc = "and a value equal or greater than 1 otherwise"]
1924 #[doc = ""]
1925 #[doc = "When no onset was detected, the first element of the output vector `onset`"]
1926 #[doc = "is set to 0."]
1927 #[doc = ""]
1928 #[doc = "When an onset is found, the first element of the output vector `onset` is set"]
1929 #[doc = "to `offset = 1 + a` where `a` is a number in the range`[0, 1]`."]
1930 #[doc = ""]
1931 #[doc = "The final onset detection time, in samples, can be obtained with"]
1932 #[doc = "aubio_onset_get_last(). It can also be derived from `offset` as"]
1933 #[doc = "follows:"]
1934 #[doc = ""]
1935 #[doc = "\\code"]
1936 #[doc = "t = total_frames + offset * hop_size - delay"]
1937 #[doc = "\\endcode"]
1938 #[doc = ""]
1939 #[doc = "where `total_frames` is the total number of frames processed so far, and"]
1940 #[doc = "`delay` is the current delay of the onset object, as returned by"]
1941 #[doc = "aubio_onset_get_delay()."]
1942 pub fn aubio_onset_do(o: *mut aubio_onset_t, input: *const fvec_t, onset: *mut fvec_t);
1943}
1944extern "C" {
1945 #[doc = " get the time of the latest onset detected, in samples"]
1946 #[doc = ""]
1947 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
1948 #[doc = ""]
1949 #[doc = "\\return onset detection timestamps (in samples)"]
1950 pub fn aubio_onset_get_last(o: *const aubio_onset_t) -> uint_t;
1951}
1952extern "C" {
1953 #[doc = " get the time of the latest onset detected, in seconds"]
1954 #[doc = ""]
1955 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
1956 #[doc = ""]
1957 #[doc = "\\return onset detection timestamps (in seconds)"]
1958 pub fn aubio_onset_get_last_s(o: *const aubio_onset_t) -> smpl_t;
1959}
1960extern "C" {
1961 #[doc = " get the time of the latest onset detected, in milliseconds"]
1962 #[doc = ""]
1963 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
1964 #[doc = ""]
1965 #[doc = "\\return onset detection timestamps (in milliseconds)"]
1966 pub fn aubio_onset_get_last_ms(o: *const aubio_onset_t) -> smpl_t;
1967}
1968extern "C" {
1969 #[doc = " set onset detection adaptive whitening"]
1970 #[doc = ""]
1971 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
1972 #[doc = "\\param enable 1 to enable, 0 to disable"]
1973 #[doc = ""]
1974 #[doc = "\\return 0 if successful, 1 otherwise"]
1975 pub fn aubio_onset_set_awhitening(o: *mut aubio_onset_t, enable: uint_t) -> uint_t;
1976}
1977extern "C" {
1978 #[doc = " get onset detection adaptive whitening"]
1979 #[doc = ""]
1980 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
1981 #[doc = ""]
1982 #[doc = "\\return 1 if enabled, 0 otherwise"]
1983 pub fn aubio_onset_get_awhitening(o: *mut aubio_onset_t) -> smpl_t;
1984}
1985extern "C" {
1986 #[doc = " set or disable log compression"]
1987 #[doc = ""]
1988 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
1989 #[doc = "\\param lambda logarithmic compression factor, 0 to disable"]
1990 #[doc = ""]
1991 #[doc = "\\return 0 if successful, 1 otherwise"]
1992 #[doc = ""]
1993 pub fn aubio_onset_set_compression(o: *mut aubio_onset_t, lambda: smpl_t) -> uint_t;
1994}
1995extern "C" {
1996 #[doc = " get onset detection log compression"]
1997 #[doc = ""]
1998 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
1999 #[doc = ""]
2000 #[doc = "\\returns 0 if disabled, compression factor otherwise"]
2001 #[doc = ""]
2002 pub fn aubio_onset_get_compression(o: *mut aubio_onset_t) -> smpl_t;
2003}
2004extern "C" {
2005 #[doc = " set onset detection silence threshold"]
2006 #[doc = ""]
2007 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2008 #[doc = "\\param silence new silence detection threshold"]
2009 pub fn aubio_onset_set_silence(o: *mut aubio_onset_t, silence: smpl_t) -> uint_t;
2010}
2011extern "C" {
2012 #[doc = " get onset detection silence threshold"]
2013 #[doc = ""]
2014 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2015 #[doc = ""]
2016 #[doc = "\\return current silence threshold"]
2017 pub fn aubio_onset_get_silence(o: *const aubio_onset_t) -> smpl_t;
2018}
2019extern "C" {
2020 #[doc = " get onset detection function"]
2021 #[doc = ""]
2022 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2023 #[doc = "\\return the current value of the descriptor"]
2024 pub fn aubio_onset_get_descriptor(o: *const aubio_onset_t) -> smpl_t;
2025}
2026extern "C" {
2027 #[doc = " get thresholded onset detection function"]
2028 #[doc = ""]
2029 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2030 #[doc = "\\return the value of the thresholded descriptor"]
2031 pub fn aubio_onset_get_thresholded_descriptor(o: *const aubio_onset_t) -> smpl_t;
2032}
2033extern "C" {
2034 #[doc = " set onset detection peak picking threshold"]
2035 #[doc = ""]
2036 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2037 #[doc = "\\param threshold new peak-picking threshold"]
2038 pub fn aubio_onset_set_threshold(o: *mut aubio_onset_t, threshold: smpl_t) -> uint_t;
2039}
2040extern "C" {
2041 #[doc = " set minimum inter onset interval in samples"]
2042 #[doc = ""]
2043 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2044 #[doc = "\\param minioi minimum interval between two consecutive onsets (in"]
2045 #[doc = "samples)"]
2046 pub fn aubio_onset_set_minioi(o: *mut aubio_onset_t, minioi: uint_t) -> uint_t;
2047}
2048extern "C" {
2049 #[doc = " set minimum inter onset interval in seconds"]
2050 #[doc = ""]
2051 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2052 #[doc = "\\param minioi minimum interval between two consecutive onsets (in"]
2053 #[doc = "seconds)"]
2054 pub fn aubio_onset_set_minioi_s(o: *mut aubio_onset_t, minioi: smpl_t) -> uint_t;
2055}
2056extern "C" {
2057 #[doc = " set minimum inter onset interval in milliseconds"]
2058 #[doc = ""]
2059 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2060 #[doc = "\\param minioi minimum interval between two consecutive onsets (in"]
2061 #[doc = "milliseconds)"]
2062 pub fn aubio_onset_set_minioi_ms(o: *mut aubio_onset_t, minioi: smpl_t) -> uint_t;
2063}
2064extern "C" {
2065 #[doc = " set delay in samples"]
2066 #[doc = ""]
2067 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2068 #[doc = "\\param delay constant system delay to take back from detection time"]
2069 #[doc = "(in samples)"]
2070 pub fn aubio_onset_set_delay(o: *mut aubio_onset_t, delay: uint_t) -> uint_t;
2071}
2072extern "C" {
2073 #[doc = " set delay in seconds"]
2074 #[doc = ""]
2075 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2076 #[doc = "\\param delay constant system delay to take back from detection time"]
2077 #[doc = "(in seconds)"]
2078 pub fn aubio_onset_set_delay_s(o: *mut aubio_onset_t, delay: smpl_t) -> uint_t;
2079}
2080extern "C" {
2081 #[doc = " set delay in milliseconds"]
2082 #[doc = ""]
2083 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2084 #[doc = "\\param delay constant system delay to take back from detection time"]
2085 #[doc = "(in milliseconds)"]
2086 pub fn aubio_onset_set_delay_ms(o: *mut aubio_onset_t, delay: smpl_t) -> uint_t;
2087}
2088extern "C" {
2089 #[doc = " get minimum inter onset interval in samples"]
2090 #[doc = ""]
2091 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2092 #[doc = "\\return minimum interval between two consecutive onsets (in"]
2093 #[doc = "samples)"]
2094 pub fn aubio_onset_get_minioi(o: *const aubio_onset_t) -> uint_t;
2095}
2096extern "C" {
2097 #[doc = " get minimum inter onset interval in seconds"]
2098 #[doc = ""]
2099 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2100 #[doc = "\\return minimum interval between two consecutive onsets (in"]
2101 #[doc = "seconds)"]
2102 pub fn aubio_onset_get_minioi_s(o: *const aubio_onset_t) -> smpl_t;
2103}
2104extern "C" {
2105 #[doc = " get minimum inter onset interval in milliseconds"]
2106 #[doc = ""]
2107 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2108 #[doc = "\\return minimum interval between two consecutive onsets (in"]
2109 #[doc = "milliseconds)"]
2110 pub fn aubio_onset_get_minioi_ms(o: *const aubio_onset_t) -> smpl_t;
2111}
2112extern "C" {
2113 #[doc = " get delay in samples"]
2114 #[doc = ""]
2115 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2116 #[doc = "\\return constant system delay to take back from detection time"]
2117 #[doc = "(in samples)"]
2118 pub fn aubio_onset_get_delay(o: *const aubio_onset_t) -> uint_t;
2119}
2120extern "C" {
2121 #[doc = " get delay in seconds"]
2122 #[doc = ""]
2123 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2124 #[doc = "\\return constant system delay to take back from detection time"]
2125 #[doc = "(in seconds)"]
2126 pub fn aubio_onset_get_delay_s(o: *const aubio_onset_t) -> smpl_t;
2127}
2128extern "C" {
2129 #[doc = " get delay in milliseconds"]
2130 #[doc = ""]
2131 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2132 #[doc = "\\return constant system delay to take back from detection time"]
2133 #[doc = "(in milliseconds)"]
2134 pub fn aubio_onset_get_delay_ms(o: *const aubio_onset_t) -> smpl_t;
2135}
2136extern "C" {
2137 #[doc = " get onset peak picking threshold"]
2138 #[doc = ""]
2139 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2140 #[doc = "\\return current onset detection threshold"]
2141 pub fn aubio_onset_get_threshold(o: *const aubio_onset_t) -> smpl_t;
2142}
2143extern "C" {
2144 #[doc = " set default parameters"]
2145 #[doc = ""]
2146 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2147 #[doc = "\\param onset_mode detection mode to adjust"]
2148 #[doc = ""]
2149 #[doc = "This function is called at the end of new_aubio_onset()."]
2150 #[doc = ""]
2151 pub fn aubio_onset_set_default_parameters(
2152 o: *mut aubio_onset_t,
2153 onset_mode: *const char_t,
2154 ) -> uint_t;
2155}
2156extern "C" {
2157 #[doc = " reset onset detection"]
2158 #[doc = ""]
2159 #[doc = "\\param o onset detection object as returned by new_aubio_onset()"]
2160 #[doc = ""]
2161 #[doc = "Reset current time and last onset to 0."]
2162 #[doc = ""]
2163 #[doc = "This function is called at the end of new_aubio_onset()."]
2164 #[doc = ""]
2165 pub fn aubio_onset_reset(o: *mut aubio_onset_t);
2166}
2167extern "C" {
2168 #[doc = " delete onset detection object"]
2169 #[doc = ""]
2170 #[doc = "\\param o onset detection object to delete"]
2171 pub fn del_aubio_onset(o: *mut aubio_onset_t);
2172}
2173#[repr(C)]
2174#[derive(Debug, Copy, Clone)]
2175pub struct _aubio_tempo_t {
2176 _unused: [u8; 0],
2177}
2178#[doc = " tempo detection structure"]
2179pub type aubio_tempo_t = _aubio_tempo_t;
2180extern "C" {
2181 #[doc = " create tempo detection object"]
2182 #[doc = ""]
2183 #[doc = "\\param method beat tracking method, unused for now (use \"default\")"]
2184 #[doc = "\\param buf_size length of FFT"]
2185 #[doc = "\\param hop_size number of frames between two consecutive runs"]
2186 #[doc = "\\param samplerate sampling rate of the signal to analyze"]
2187 #[doc = ""]
2188 #[doc = "\\return newly created ::aubio_tempo_t if successful, `NULL` otherwise"]
2189 pub fn new_aubio_tempo(
2190 method: *const char_t,
2191 buf_size: uint_t,
2192 hop_size: uint_t,
2193 samplerate: uint_t,
2194 ) -> *mut aubio_tempo_t;
2195}
2196extern "C" {
2197 #[doc = " execute tempo detection"]
2198 #[doc = ""]
2199 #[doc = "\\param o beat tracking object"]
2200 #[doc = "\\param input new samples"]
2201 #[doc = "\\param tempo output beats"]
2202 pub fn aubio_tempo_do(o: *mut aubio_tempo_t, input: *const fvec_t, tempo: *mut fvec_t);
2203}
2204extern "C" {
2205 #[doc = " get the time of the latest beat detected, in samples"]
2206 #[doc = ""]
2207 #[doc = "\\param o tempo detection object as returned by ::new_aubio_tempo"]
2208 pub fn aubio_tempo_get_last(o: *mut aubio_tempo_t) -> uint_t;
2209}
2210extern "C" {
2211 #[doc = " get the time of the latest beat detected, in seconds"]
2212 #[doc = ""]
2213 #[doc = "\\param o tempo detection object as returned by ::new_aubio_tempo"]
2214 pub fn aubio_tempo_get_last_s(o: *mut aubio_tempo_t) -> smpl_t;
2215}
2216extern "C" {
2217 #[doc = " get the time of the latest beat detected, in milliseconds"]
2218 #[doc = ""]
2219 #[doc = "\\param o tempo detection object as returned by ::new_aubio_tempo"]
2220 pub fn aubio_tempo_get_last_ms(o: *mut aubio_tempo_t) -> smpl_t;
2221}
2222extern "C" {
2223 #[doc = " set tempo detection silence threshold"]
2224 #[doc = ""]
2225 #[doc = "\\param o beat tracking object"]
2226 #[doc = "\\param silence new silence threshold, in dB"]
2227 #[doc = ""]
2228 #[doc = "\\return `0` if successful, non-zero otherwise"]
2229 pub fn aubio_tempo_set_silence(o: *mut aubio_tempo_t, silence: smpl_t) -> uint_t;
2230}
2231extern "C" {
2232 #[doc = " get tempo detection silence threshold"]
2233 #[doc = ""]
2234 #[doc = "\\param o tempo detection object as returned by new_aubio_tempo()"]
2235 #[doc = ""]
2236 #[doc = "\\return current silence threshold"]
2237 pub fn aubio_tempo_get_silence(o: *mut aubio_tempo_t) -> smpl_t;
2238}
2239extern "C" {
2240 #[doc = " set tempo detection peak picking threshold"]
2241 #[doc = ""]
2242 #[doc = "\\param o beat tracking object"]
2243 #[doc = "\\param threshold new threshold"]
2244 #[doc = ""]
2245 #[doc = "\\return `0` if successful, non-zero otherwise"]
2246 pub fn aubio_tempo_set_threshold(o: *mut aubio_tempo_t, threshold: smpl_t) -> uint_t;
2247}
2248extern "C" {
2249 #[doc = " get tempo peak picking threshold"]
2250 #[doc = ""]
2251 #[doc = "\\param o tempo detection object as returned by new_aubio_tempo()"]
2252 #[doc = ""]
2253 #[doc = "\\return current tempo detection threshold"]
2254 pub fn aubio_tempo_get_threshold(o: *mut aubio_tempo_t) -> smpl_t;
2255}
2256extern "C" {
2257 #[doc = " get current beat period in samples"]
2258 #[doc = ""]
2259 #[doc = "\\param bt beat tracking object"]
2260 #[doc = ""]
2261 #[doc = "Returns the currently observed period, in samples, or 0 if no consistent"]
2262 #[doc = "value is found."]
2263 pub fn aubio_tempo_get_period(bt: *mut aubio_tempo_t) -> smpl_t;
2264}
2265extern "C" {
2266 #[doc = " get current beat period in seconds"]
2267 #[doc = ""]
2268 #[doc = "\\param bt beat tracking object"]
2269 #[doc = ""]
2270 #[doc = "Returns the currently observed period, in seconds, or 0 if no consistent"]
2271 #[doc = "value is found."]
2272 pub fn aubio_tempo_get_period_s(bt: *mut aubio_tempo_t) -> smpl_t;
2273}
2274extern "C" {
2275 #[doc = " get current tempo"]
2276 #[doc = ""]
2277 #[doc = "\\param o beat tracking object"]
2278 #[doc = ""]
2279 #[doc = "\\return the currently observed tempo, or `0` if no consistent value is found"]
2280 pub fn aubio_tempo_get_bpm(o: *mut aubio_tempo_t) -> smpl_t;
2281}
2282extern "C" {
2283 #[doc = " get current tempo confidence"]
2284 #[doc = ""]
2285 #[doc = "\\param o beat tracking object"]
2286 #[doc = ""]
2287 #[doc = "\\return confidence with which the tempo has been observed, the higher the"]
2288 #[doc = "more confidence, `0` if no consistent value is found."]
2289 pub fn aubio_tempo_get_confidence(o: *mut aubio_tempo_t) -> smpl_t;
2290}
2291extern "C" {
2292 #[doc = " set number of tatum per beat"]
2293 #[doc = ""]
2294 #[doc = "\\param o beat tracking object"]
2295 #[doc = "\\param signature number of tatum per beat (between 1 and 64)"]
2296 pub fn aubio_tempo_set_tatum_signature(o: *mut aubio_tempo_t, signature: uint_t) -> uint_t;
2297}
2298extern "C" {
2299 #[doc = " check whether a tatum was detected in the current frame"]
2300 #[doc = ""]
2301 #[doc = "\\param o beat tracking object"]
2302 #[doc = ""]
2303 #[doc = "\\return 2 if a beat was detected, 1 if a tatum was detected, 0 otherwise"]
2304 pub fn aubio_tempo_was_tatum(o: *mut aubio_tempo_t) -> uint_t;
2305}
2306extern "C" {
2307 #[doc = " get position of last_tatum, in samples"]
2308 #[doc = ""]
2309 #[doc = "\\param o beat tracking object"]
2310 pub fn aubio_tempo_get_last_tatum(o: *mut aubio_tempo_t) -> smpl_t;
2311}
2312extern "C" {
2313 #[doc = " get current delay"]
2314 #[doc = ""]
2315 #[doc = "\\param o beat tracking object"]
2316 #[doc = ""]
2317 #[doc = "\\return current delay, in samples"]
2318 #[doc = ""]
2319 pub fn aubio_tempo_get_delay(o: *mut aubio_tempo_t) -> uint_t;
2320}
2321extern "C" {
2322 #[doc = " get current delay in seconds"]
2323 #[doc = ""]
2324 #[doc = "\\param o beat tracking object"]
2325 #[doc = ""]
2326 #[doc = "\\return current delay, in seconds"]
2327 #[doc = ""]
2328 pub fn aubio_tempo_get_delay_s(o: *mut aubio_tempo_t) -> smpl_t;
2329}
2330extern "C" {
2331 #[doc = " get current delay in ms"]
2332 #[doc = ""]
2333 #[doc = "\\param o beat tracking object"]
2334 #[doc = ""]
2335 #[doc = "\\return current delay, in milliseconds"]
2336 #[doc = ""]
2337 pub fn aubio_tempo_get_delay_ms(o: *mut aubio_tempo_t) -> smpl_t;
2338}
2339extern "C" {
2340 #[doc = " set current delay"]
2341 #[doc = ""]
2342 #[doc = "\\param o beat tracking object"]
2343 #[doc = "\\param delay delay to set tempo to, in samples"]
2344 #[doc = ""]
2345 #[doc = "\\return `0` if successful, non-zero otherwise"]
2346 #[doc = ""]
2347 pub fn aubio_tempo_set_delay(o: *mut aubio_tempo_t, delay: sint_t) -> uint_t;
2348}
2349extern "C" {
2350 #[doc = " set current delay in seconds"]
2351 #[doc = ""]
2352 #[doc = "\\param o beat tracking object"]
2353 #[doc = "\\param delay delay to set tempo to, in seconds"]
2354 #[doc = ""]
2355 #[doc = "\\return `0` if successful, non-zero otherwise"]
2356 #[doc = ""]
2357 pub fn aubio_tempo_set_delay_s(o: *mut aubio_tempo_t, delay: smpl_t) -> uint_t;
2358}
2359extern "C" {
2360 #[doc = " set current delay"]
2361 #[doc = ""]
2362 #[doc = "\\param o beat tracking object"]
2363 #[doc = "\\param delay delay to set tempo to, in samples"]
2364 #[doc = ""]
2365 #[doc = "\\return `0` if successful, non-zero otherwise"]
2366 #[doc = ""]
2367 pub fn aubio_tempo_set_delay_ms(o: *mut aubio_tempo_t, delay: smpl_t) -> uint_t;
2368}
2369extern "C" {
2370 #[doc = " delete tempo detection object"]
2371 #[doc = ""]
2372 #[doc = "\\param o beat tracking object"]
2373 pub fn del_aubio_tempo(o: *mut aubio_tempo_t);
2374}
2375#[repr(C)]
2376#[derive(Debug, Copy, Clone)]
2377pub struct _aubio_notes_t {
2378 _unused: [u8; 0],
2379}
2380#[doc = " notes detection object"]
2381pub type aubio_notes_t = _aubio_notes_t;
2382extern "C" {
2383 #[doc = " create notes detection object"]
2384 #[doc = ""]
2385 #[doc = "\\param method notes detection type as specified in specdesc.h"]
2386 #[doc = "\\param buf_size buffer size for phase vocoder"]
2387 #[doc = "\\param hop_size hop size for phase vocoder"]
2388 #[doc = "\\param samplerate sampling rate of the input signal"]
2389 #[doc = ""]
2390 #[doc = "\\return newly created ::aubio_notes_t"]
2391 pub fn new_aubio_notes(
2392 method: *const char_t,
2393 buf_size: uint_t,
2394 hop_size: uint_t,
2395 samplerate: uint_t,
2396 ) -> *mut aubio_notes_t;
2397}
2398extern "C" {
2399 #[doc = " delete notes detection object"]
2400 #[doc = ""]
2401 #[doc = "\\param o notes detection object to delete"]
2402 pub fn del_aubio_notes(o: *mut aubio_notes_t);
2403}
2404extern "C" {
2405 #[doc = " execute note detection on an input signal frame"]
2406 #[doc = ""]
2407 #[doc = "\\param o note detection object as returned by new_aubio_notes()"]
2408 #[doc = "\\param input input signal of size [hop_size]"]
2409 #[doc = "\\param output output notes, fvec of length 3"]
2410 #[doc = ""]
2411 #[doc = "The notes output is a vector of length 3 containing:"]
2412 #[doc = "- 0. the midi note value, or 0 if no note was found"]
2413 #[doc = "- 1. the note velocity"]
2414 #[doc = "- 2. the midi note to turn off"]
2415 pub fn aubio_notes_do(o: *mut aubio_notes_t, input: *const fvec_t, output: *mut fvec_t);
2416}
2417extern "C" {
2418 #[doc = " set notes detection silence threshold"]
2419 #[doc = ""]
2420 #[doc = "\\param o notes detection object as returned by new_aubio_notes()"]
2421 #[doc = "\\param silence new silence detection threshold"]
2422 #[doc = ""]
2423 #[doc = "\\return 0 on success, non-zero otherwise"]
2424 pub fn aubio_notes_set_silence(o: *mut aubio_notes_t, silence: smpl_t) -> uint_t;
2425}
2426extern "C" {
2427 #[doc = " get notes detection silence threshold"]
2428 #[doc = ""]
2429 #[doc = "\\param o notes detection object as returned by new_aubio_notes()"]
2430 #[doc = ""]
2431 #[doc = "\\return current silence threshold"]
2432 pub fn aubio_notes_get_silence(o: *const aubio_notes_t) -> smpl_t;
2433}
2434extern "C" {
2435 #[doc = " get notes detection minimum inter-onset interval, in millisecond"]
2436 #[doc = ""]
2437 #[doc = "\\param o notes detection object as returned by new_aubio_notes()"]
2438 #[doc = ""]
2439 #[doc = "\\return current minimum inter onset interval"]
2440 #[doc = ""]
2441 pub fn aubio_notes_get_minioi_ms(o: *const aubio_notes_t) -> smpl_t;
2442}
2443extern "C" {
2444 #[doc = " set notes detection minimum inter-onset interval, in millisecond"]
2445 #[doc = ""]
2446 #[doc = "\\param o notes detection object as returned by new_aubio_notes()"]
2447 #[doc = "\\param minioi_ms new inter-onset interval"]
2448 #[doc = ""]
2449 #[doc = "\\return 0 on success, non-zero otherwise"]
2450 pub fn aubio_notes_set_minioi_ms(o: *mut aubio_notes_t, minioi_ms: smpl_t) -> uint_t;
2451}
2452extern "C" {
2453 #[doc = " get notes object release drop level, in dB"]
2454 #[doc = ""]
2455 #[doc = "\\param o notes detection object as returned by new_aubio_notes()"]
2456 #[doc = ""]
2457 #[doc = "\\return current release drop level, in dB"]
2458 #[doc = ""]
2459 pub fn aubio_notes_get_release_drop(o: *const aubio_notes_t) -> smpl_t;
2460}
2461extern "C" {
2462 #[doc = " set note release drop level, in dB"]
2463 #[doc = ""]
2464 #[doc = "This function sets the release_drop_level parameter, in dB. When a new note"]
2465 #[doc = "is found, the current level in dB is measured. If the measured level drops"]
2466 #[doc = "under that initial level - release_drop_level, then a note-off will be"]
2467 #[doc = "emitted."]
2468 #[doc = ""]
2469 #[doc = "Defaults to `10`, in dB."]
2470 #[doc = ""]
2471 #[doc = "\\note This parameter was added in version `0.4.8`. Results obtained with"]
2472 #[doc = "earlier versions can be reproduced by setting this value to `100`, so that"]
2473 #[doc = "note-off will not be played until the next note."]
2474 #[doc = ""]
2475 #[doc = "\\param o notes detection object as returned by new_aubio_notes()"]
2476 #[doc = "\\param release_drop new release drop level, in dB"]
2477 #[doc = ""]
2478 #[doc = "\\return 0 on success, non-zero otherwise"]
2479 pub fn aubio_notes_set_release_drop(o: *mut aubio_notes_t, release_drop: smpl_t) -> uint_t;
2480}
2481#[repr(C)]
2482#[derive(Debug, Copy, Clone)]
2483pub struct _aubio_source_t {
2484 _unused: [u8; 0],
2485}
2486#[doc = " media source object"]
2487pub type aubio_source_t = _aubio_source_t;
2488extern "C" {
2489 #[doc = "create new ::aubio_source_t"]
2490 #[doc = ""]
2491 #[doc = "\\param uri the file path or uri to read from"]
2492 #[doc = "\\param samplerate sampling rate to view the fie at"]
2493 #[doc = "\\param hop_size the size of the blocks to read from"]
2494 #[doc = ""]
2495 #[doc = "Creates a new source object. If `0` is passed as `samplerate`, the sample"]
2496 #[doc = "rate of the original file is used."]
2497 #[doc = ""]
2498 #[doc = "The samplerate of newly created source can be obtained using"]
2499 #[doc = "::aubio_source_get_samplerate."]
2500 pub fn new_aubio_source(
2501 uri: *const char_t,
2502 samplerate: uint_t,
2503 hop_size: uint_t,
2504 ) -> *mut aubio_source_t;
2505}
2506extern "C" {
2507 #[doc = "read monophonic vector of length hop_size from source object"]
2508 #[doc = ""]
2509 #[doc = "\\param s source object, created with ::new_aubio_source"]
2510 #[doc = "\\param read_to ::fvec_t of data to read to"]
2511 #[doc = "\\param read upon returns, equals to number of frames actually read"]
2512 #[doc = ""]
2513 #[doc = "Upon returns, `read` contains the number of frames actually read from the"]
2514 #[doc = "source. `hop_size` if enough frames could be read, less otherwise."]
2515 pub fn aubio_source_do(s: *mut aubio_source_t, read_to: *mut fvec_t, read: *mut uint_t);
2516}
2517extern "C" {
2518 #[doc = "read polyphonic vector of length hop_size from source object"]
2519 #[doc = ""]
2520 #[doc = "\\param s source object, created with ::new_aubio_source"]
2521 #[doc = "\\param read_to ::fmat_t of data to read to"]
2522 #[doc = "\\param[out] read upon returns, equals to number of frames actually read"]
2523 #[doc = ""]
2524 #[doc = "Upon returns, `read` contains the number of frames actually read from the"]
2525 #[doc = "source. `hop_size` if enough frames could be read, less otherwise."]
2526 pub fn aubio_source_do_multi(s: *mut aubio_source_t, read_to: *mut fmat_t, read: *mut uint_t);
2527}
2528extern "C" {
2529 #[doc = "get samplerate of source object"]
2530 #[doc = ""]
2531 #[doc = "\\param s source object, created with ::new_aubio_source"]
2532 #[doc = "\\return samplerate, in Hz"]
2533 pub fn aubio_source_get_samplerate(s: *mut aubio_source_t) -> uint_t;
2534}
2535extern "C" {
2536 #[doc = "get channels of source object"]
2537 #[doc = ""]
2538 #[doc = "\\param s source object, created with ::new_aubio_source"]
2539 #[doc = "\\return channels"]
2540 pub fn aubio_source_get_channels(s: *mut aubio_source_t) -> uint_t;
2541}
2542extern "C" {
2543 #[doc = "seek source object"]
2544 #[doc = ""]
2545 #[doc = "\\param s source object, created with ::new_aubio_source"]
2546 #[doc = "\\param pos position to seek to, in frames"]
2547 #[doc = ""]
2548 #[doc = "\\return 0 if sucessful, non-zero on failure"]
2549 pub fn aubio_source_seek(s: *mut aubio_source_t, pos: uint_t) -> uint_t;
2550}
2551extern "C" {
2552 #[doc = "get the duration of source object, in frames"]
2553 #[doc = ""]
2554 #[doc = "\\param s source object, created with ::new_aubio_source"]
2555 #[doc = "\\return number of frames in file"]
2556 pub fn aubio_source_get_duration(s: *mut aubio_source_t) -> uint_t;
2557}
2558extern "C" {
2559 #[doc = "close source object"]
2560 #[doc = ""]
2561 #[doc = "\\param s source object, created with ::new_aubio_source"]
2562 #[doc = ""]
2563 #[doc = "\\return 0 if sucessful, non-zero on failure"]
2564 #[doc = ""]
2565 pub fn aubio_source_close(s: *mut aubio_source_t) -> uint_t;
2566}
2567extern "C" {
2568 #[doc = "close source and cleanup memory"]
2569 #[doc = ""]
2570 #[doc = "\\param s source object, created with ::new_aubio_source"]
2571 pub fn del_aubio_source(s: *mut aubio_source_t);
2572}
2573#[repr(C)]
2574#[derive(Debug, Copy, Clone)]
2575pub struct _aubio_sink_t {
2576 _unused: [u8; 0],
2577}
2578#[doc = " media sink object"]
2579pub type aubio_sink_t = _aubio_sink_t;
2580extern "C" {
2581 #[doc = "create new ::aubio_sink_t"]
2582 #[doc = ""]
2583 #[doc = "\\param uri the file path or uri to write to"]
2584 #[doc = "\\param samplerate sample rate to write the file at"]
2585 #[doc = ""]
2586 #[doc = "\\return newly created ::aubio_sink_t"]
2587 #[doc = ""]
2588 #[doc = "Creates a new sink object."]
2589 #[doc = ""]
2590 #[doc = "If samplerate is set to 0, the creation of the file will be delayed until"]
2591 #[doc = "both ::aubio_sink_preset_samplerate and ::aubio_sink_preset_channels have"]
2592 #[doc = "been called."]
2593 pub fn new_aubio_sink(uri: *const char_t, samplerate: uint_t) -> *mut aubio_sink_t;
2594}
2595extern "C" {
2596 #[doc = "preset sink samplerate"]
2597 #[doc = ""]
2598 #[doc = "\\param s sink, created with ::new_aubio_sink"]
2599 #[doc = "\\param samplerate samplerate to preset the sink to, in Hz"]
2600 #[doc = ""]
2601 #[doc = "\\return 0 on success, 1 on error"]
2602 #[doc = ""]
2603 #[doc = "Preset the samplerate of the sink. The file should have been created using a"]
2604 #[doc = "samplerate of 0."]
2605 #[doc = ""]
2606 #[doc = "The file will be opened only when both samplerate and channels have been set."]
2607 pub fn aubio_sink_preset_samplerate(s: *mut aubio_sink_t, samplerate: uint_t) -> uint_t;
2608}
2609extern "C" {
2610 #[doc = "preset sink channels"]
2611 #[doc = ""]
2612 #[doc = "\\param s sink, created with ::new_aubio_sink"]
2613 #[doc = "\\param channels number of channels to preset the sink to"]
2614 #[doc = ""]
2615 #[doc = "\\return 0 on success, 1 on error"]
2616 #[doc = ""]
2617 #[doc = "Preset the samplerate of the sink. The file should have been created using a"]
2618 #[doc = "samplerate of 0."]
2619 #[doc = ""]
2620 #[doc = "The file will be opened only when both samplerate and channels have been set."]
2621 pub fn aubio_sink_preset_channels(s: *mut aubio_sink_t, channels: uint_t) -> uint_t;
2622}
2623extern "C" {
2624 #[doc = "get samplerate of sink object"]
2625 #[doc = ""]
2626 #[doc = "\\param s sink object, created with ::new_aubio_sink"]
2627 #[doc = "\\return samplerate, in Hz"]
2628 pub fn aubio_sink_get_samplerate(s: *const aubio_sink_t) -> uint_t;
2629}
2630extern "C" {
2631 #[doc = "get channels of sink object"]
2632 #[doc = ""]
2633 #[doc = "\\param s sink object, created with ::new_aubio_sink"]
2634 #[doc = "\\return number of channels"]
2635 pub fn aubio_sink_get_channels(s: *const aubio_sink_t) -> uint_t;
2636}
2637extern "C" {
2638 #[doc = "write monophonic vector of length hop_size to sink"]
2639 #[doc = ""]
2640 #[doc = "\\param s sink, created with ::new_aubio_sink"]
2641 #[doc = "\\param write_data ::fvec_t samples to write to sink"]
2642 #[doc = "\\param write number of frames to write"]
2643 pub fn aubio_sink_do(s: *mut aubio_sink_t, write_data: *mut fvec_t, write: uint_t);
2644}
2645extern "C" {
2646 #[doc = "write polyphonic vector of length hop_size to sink"]
2647 #[doc = ""]
2648 #[doc = "\\param s sink, created with ::new_aubio_sink"]
2649 #[doc = "\\param write_data ::fmat_t samples to write to sink"]
2650 #[doc = "\\param write number of frames to write"]
2651 pub fn aubio_sink_do_multi(s: *mut aubio_sink_t, write_data: *mut fmat_t, write: uint_t);
2652}
2653extern "C" {
2654 #[doc = "close sink"]
2655 #[doc = ""]
2656 #[doc = "\\param s sink object, created with ::new_aubio_sink"]
2657 #[doc = ""]
2658 #[doc = "\\return 0 on success, non-zero on failure"]
2659 pub fn aubio_sink_close(s: *mut aubio_sink_t) -> uint_t;
2660}
2661extern "C" {
2662 #[doc = "close sink and cleanup memory"]
2663 #[doc = ""]
2664 #[doc = "\\param s sink object, created with ::new_aubio_sink"]
2665 pub fn del_aubio_sink(s: *mut aubio_sink_t);
2666}
2667#[repr(C)]
2668#[derive(Debug, Copy, Clone)]
2669pub struct _aubio_sampler_t {
2670 _unused: [u8; 0],
2671}
2672#[doc = " sampler object"]
2673pub type aubio_sampler_t = _aubio_sampler_t;
2674extern "C" {
2675 #[doc = " create new sampler object"]
2676 #[doc = ""]
2677 #[doc = "\\param samplerate the sampling rate of the new sampler"]
2678 #[doc = "\\param hop_size the block size of the new sampler"]
2679 #[doc = ""]
2680 #[doc = "\\return the newly created ::aubio_sampler_t"]
2681 pub fn new_aubio_sampler(samplerate: uint_t, hop_size: uint_t) -> *mut aubio_sampler_t;
2682}
2683extern "C" {
2684 #[doc = " load source in sampler"]
2685 #[doc = ""]
2686 #[doc = "\\param o sampler, created by new_aubio_sampler()"]
2687 #[doc = "\\param uri the uri of the source to load"]
2688 #[doc = ""]
2689 #[doc = "\\return 0 if successful, non-zero otherwise"]
2690 pub fn aubio_sampler_load(o: *mut aubio_sampler_t, uri: *const char_t) -> uint_t;
2691}
2692extern "C" {
2693 #[doc = " process sampler function"]
2694 #[doc = ""]
2695 #[doc = "\\param o sampler, created by new_aubio_sampler()"]
2696 #[doc = "\\param input input of the sampler, to be added to the output"]
2697 #[doc = "\\param output output of the sampler"]
2698 #[doc = ""]
2699 #[doc = "This function adds the new samples from the playing source to the output."]
2700 #[doc = ""]
2701 #[doc = "If `input` is not NULL and different from `output`, then the samples from `input`"]
2702 #[doc = "are added to the output."]
2703 pub fn aubio_sampler_do(o: *mut aubio_sampler_t, input: *const fvec_t, output: *mut fvec_t);
2704}
2705extern "C" {
2706 #[doc = " process sampler function, multiple channels"]
2707 #[doc = ""]
2708 #[doc = "\\param o sampler, created by new_aubio_sampler()"]
2709 #[doc = "\\param input input of the sampler, to be added to the output"]
2710 #[doc = "\\param output output of the sampler"]
2711 #[doc = ""]
2712 #[doc = "This function adds the new samples from the playing source to the output."]
2713 #[doc = ""]
2714 #[doc = "If `input` is not NULL and different from `output`, then the samples from `input`"]
2715 #[doc = "are added to the output."]
2716 pub fn aubio_sampler_do_multi(
2717 o: *mut aubio_sampler_t,
2718 input: *const fmat_t,
2719 output: *mut fmat_t,
2720 );
2721}
2722extern "C" {
2723 #[doc = " get current playing state"]
2724 #[doc = ""]
2725 #[doc = "\\param o sampler, created by new_aubio_sampler()"]
2726 #[doc = ""]
2727 #[doc = "\\return 0 if not playing, 1 if playing"]
2728 pub fn aubio_sampler_get_playing(o: *const aubio_sampler_t) -> uint_t;
2729}
2730extern "C" {
2731 #[doc = " set current playing state"]
2732 #[doc = ""]
2733 #[doc = "\\param o sampler, created by new_aubio_sampler()"]
2734 #[doc = "\\param playing 0 for not playing, 1 for playing"]
2735 #[doc = ""]
2736 #[doc = "\\return 0 if successful, 1 otherwise"]
2737 pub fn aubio_sampler_set_playing(o: *mut aubio_sampler_t, playing: uint_t) -> uint_t;
2738}
2739extern "C" {
2740 #[doc = " play sample from start"]
2741 #[doc = ""]
2742 #[doc = "\\param o sampler, created by new_aubio_sampler()"]
2743 #[doc = ""]
2744 #[doc = "\\return 0 if successful, 1 otherwise"]
2745 pub fn aubio_sampler_play(o: *mut aubio_sampler_t) -> uint_t;
2746}
2747extern "C" {
2748 #[doc = " stop sample"]
2749 #[doc = ""]
2750 #[doc = "\\param o sampler, created by new_aubio_sampler()"]
2751 #[doc = ""]
2752 #[doc = "\\return 0 if successful, 1 otherwise"]
2753 pub fn aubio_sampler_stop(o: *mut aubio_sampler_t) -> uint_t;
2754}
2755extern "C" {
2756 #[doc = " destroy ::aubio_sampler_t object"]
2757 #[doc = ""]
2758 #[doc = "\\param o sampler, created by new_aubio_sampler()"]
2759 pub fn del_aubio_sampler(o: *mut aubio_sampler_t);
2760}
2761#[repr(C)]
2762#[derive(Debug, Copy, Clone)]
2763pub struct _aubio_wavetable_t {
2764 _unused: [u8; 0],
2765}
2766#[doc = " wavetable object"]
2767pub type aubio_wavetable_t = _aubio_wavetable_t;
2768extern "C" {
2769 #[doc = " create new wavetable object"]
2770 #[doc = ""]
2771 #[doc = "\\param samplerate the sampling rate of the new wavetable"]
2772 #[doc = "\\param hop_size the block size of the new wavetable"]
2773 #[doc = ""]
2774 #[doc = "\\return the newly created aubio_wavetable_t"]
2775 pub fn new_aubio_wavetable(samplerate: uint_t, hop_size: uint_t) -> *mut aubio_wavetable_t;
2776}
2777extern "C" {
2778 #[doc = " load source in wavetable"]
2779 #[doc = ""]
2780 #[doc = "TODO: This function is not implemented yet. See new_aubio_sampler() instead."]
2781 #[doc = ""]
2782 #[doc = "\\param o wavetable, created by new_aubio_wavetable()"]
2783 #[doc = "\\param uri the uri of the source to load"]
2784 #[doc = ""]
2785 #[doc = "\\return 0 if successful, non-zero otherwise"]
2786 pub fn aubio_wavetable_load(o: *mut aubio_wavetable_t, uri: *const char_t) -> uint_t;
2787}
2788extern "C" {
2789 #[doc = " process wavetable function"]
2790 #[doc = ""]
2791 #[doc = "\\param o wavetable, created by new_aubio_wavetable()"]
2792 #[doc = "\\param input input of the wavetable, to be added to the output"]
2793 #[doc = "\\param output output of the wavetable"]
2794 #[doc = ""]
2795 #[doc = "This function adds the new samples from the playing wavetable to the output."]
2796 #[doc = ""]
2797 #[doc = "If `input` is not NULL and different from `output`, then the samples from `input`"]
2798 #[doc = "are added to the output."]
2799 pub fn aubio_wavetable_do(o: *mut aubio_wavetable_t, input: *const fvec_t, output: *mut fvec_t);
2800}
2801extern "C" {
2802 #[doc = " process wavetable function, multiple channels"]
2803 #[doc = ""]
2804 #[doc = "\\param o wavetable, created by new_aubio_wavetable()"]
2805 #[doc = "\\param input input of the wavetable, to be added to the output"]
2806 #[doc = "\\param output output of the wavetable"]
2807 #[doc = ""]
2808 #[doc = "This function adds the new samples from the playing wavetable to the output."]
2809 #[doc = ""]
2810 #[doc = "If `input` is not NULL and different from `output`, then the samples from `input`"]
2811 #[doc = "are added to the output."]
2812 pub fn aubio_wavetable_do_multi(
2813 o: *mut aubio_wavetable_t,
2814 input: *const fmat_t,
2815 output: *mut fmat_t,
2816 );
2817}
2818extern "C" {
2819 #[doc = " get current playing state"]
2820 #[doc = ""]
2821 #[doc = "\\param o wavetable, created by new_aubio_wavetable()"]
2822 #[doc = ""]
2823 #[doc = "\\return 0 if not playing, 1 if playing"]
2824 pub fn aubio_wavetable_get_playing(o: *const aubio_wavetable_t) -> uint_t;
2825}
2826extern "C" {
2827 #[doc = " set current playing state"]
2828 #[doc = ""]
2829 #[doc = "\\param o wavetable, created by new_aubio_wavetable()"]
2830 #[doc = "\\param playing 0 for not playing, 1 for playing"]
2831 #[doc = ""]
2832 #[doc = "\\return 0 if successful, 1 otherwise"]
2833 pub fn aubio_wavetable_set_playing(o: *mut aubio_wavetable_t, playing: uint_t) -> uint_t;
2834}
2835extern "C" {
2836 #[doc = " play sample from start"]
2837 #[doc = ""]
2838 #[doc = "\\param o wavetable, created by new_aubio_wavetable()"]
2839 #[doc = ""]
2840 #[doc = "\\return 0 if successful, 1 otherwise"]
2841 pub fn aubio_wavetable_play(o: *mut aubio_wavetable_t) -> uint_t;
2842}
2843extern "C" {
2844 #[doc = " stop wavetable"]
2845 #[doc = ""]
2846 #[doc = "\\param o wavetable, created by new_aubio_wavetable()"]
2847 #[doc = ""]
2848 #[doc = "\\return 0 if successful, 1 otherwise"]
2849 pub fn aubio_wavetable_stop(o: *mut aubio_wavetable_t) -> uint_t;
2850}
2851extern "C" {
2852 #[doc = " set wavetable frequency"]
2853 #[doc = ""]
2854 #[doc = "\\param o wavetable, created by new_aubio_wavetable()"]
2855 #[doc = "\\param freq new frequency value for the wavetable"]
2856 #[doc = ""]
2857 #[doc = "\\return 0 if successful, 1 otherwise"]
2858 pub fn aubio_wavetable_set_freq(o: *mut aubio_wavetable_t, freq: smpl_t) -> uint_t;
2859}
2860extern "C" {
2861 #[doc = " get wavetable frequency"]
2862 #[doc = ""]
2863 #[doc = "\\param o wavetable, created by new_aubio_wavetable()"]
2864 #[doc = ""]
2865 #[doc = "\\return current frequency, in Hz"]
2866 pub fn aubio_wavetable_get_freq(o: *const aubio_wavetable_t) -> smpl_t;
2867}
2868extern "C" {
2869 #[doc = " set wavetable amplitude"]
2870 #[doc = ""]
2871 #[doc = "\\param o wavetable, created by new_aubio_wavetable()"]
2872 #[doc = "\\param amp new amplitude value for the wavetable"]
2873 #[doc = ""]
2874 #[doc = "\\return 0 if successful, 1 otherwise"]
2875 pub fn aubio_wavetable_set_amp(o: *mut aubio_wavetable_t, amp: smpl_t) -> uint_t;
2876}
2877extern "C" {
2878 #[doc = " get wavetable amplitude"]
2879 #[doc = ""]
2880 #[doc = "\\param o wavetable, created by new_aubio_wavetable()"]
2881 #[doc = ""]
2882 #[doc = "\\return current amplitude"]
2883 pub fn aubio_wavetable_get_amp(o: *const aubio_wavetable_t) -> smpl_t;
2884}
2885extern "C" {
2886 #[doc = " destroy aubio_wavetable_t object"]
2887 #[doc = ""]
2888 #[doc = "\\param o wavetable, created by new_aubio_wavetable()"]
2889 pub fn del_aubio_wavetable(o: *mut aubio_wavetable_t);
2890}
2891#[repr(C)]
2892#[derive(Debug, Copy, Clone)]
2893pub struct _aubio_parameter_t {
2894 _unused: [u8; 0],
2895}
2896#[doc = " parameter object"]
2897pub type aubio_parameter_t = _aubio_parameter_t;
2898extern "C" {
2899 #[doc = " create new parameter object"]
2900 #[doc = ""]
2901 #[doc = "\\param min_value the minimum value of the new parameter"]
2902 #[doc = "\\param max_value the maximum value of the new parameter"]
2903 #[doc = "\\param steps the number of steps to interpolate from the old value to the target value"]
2904 #[doc = ""]
2905 #[doc = "\\return the newly created ::aubio_parameter_t"]
2906 pub fn new_aubio_parameter(
2907 min_value: smpl_t,
2908 max_value: smpl_t,
2909 steps: uint_t,
2910 ) -> *mut aubio_parameter_t;
2911}
2912extern "C" {
2913 #[doc = " set target value of the parameter"]
2914 #[doc = ""]
2915 #[doc = "\\param param parameter, created by ::new_aubio_parameter"]
2916 #[doc = "\\param value new target value"]
2917 #[doc = ""]
2918 #[doc = "\\return 0 if successful, 1 otherwise"]
2919 pub fn aubio_parameter_set_target_value(param: *mut aubio_parameter_t, value: smpl_t)
2920 -> uint_t;
2921}
2922extern "C" {
2923 #[doc = " get next parameter"]
2924 #[doc = ""]
2925 #[doc = "\\param param parameter, created by ::new_aubio_parameter"]
2926 #[doc = ""]
2927 #[doc = "\\return new interpolated parameter value"]
2928 pub fn aubio_parameter_get_next_value(param: *mut aubio_parameter_t) -> smpl_t;
2929}
2930extern "C" {
2931 #[doc = " get current parameter value, without interpolation"]
2932 #[doc = ""]
2933 #[doc = "\\param param parameter, created by ::new_aubio_parameter"]
2934 #[doc = ""]
2935 #[doc = "\\return current value"]
2936 pub fn aubio_parameter_get_current_value(param: *const aubio_parameter_t) -> smpl_t;
2937}
2938extern "C" {
2939 #[doc = " set current parameter value, skipping interpolation"]
2940 #[doc = ""]
2941 #[doc = "\\param param parameter, created by ::new_aubio_parameter"]
2942 #[doc = "\\param value new parameter value"]
2943 #[doc = ""]
2944 #[doc = "\\return 0 if successful, 1 otherwise"]
2945 pub fn aubio_parameter_set_current_value(
2946 param: *mut aubio_parameter_t,
2947 value: smpl_t,
2948 ) -> uint_t;
2949}
2950extern "C" {
2951 #[doc = " set number of steps used for interpolation"]
2952 #[doc = ""]
2953 #[doc = "\\param param parameter, created by ::new_aubio_parameter"]
2954 #[doc = "\\param steps new number of steps"]
2955 #[doc = ""]
2956 #[doc = "\\return 0 if successful, 1 otherwise"]
2957 pub fn aubio_parameter_set_steps(param: *mut aubio_parameter_t, steps: uint_t) -> uint_t;
2958}
2959extern "C" {
2960 #[doc = " get number of steps of this parameter"]
2961 #[doc = ""]
2962 #[doc = "\\param param parameter, created by ::new_aubio_parameter"]
2963 #[doc = ""]
2964 #[doc = "\\return number of steps"]
2965 pub fn aubio_parameter_get_steps(param: *const aubio_parameter_t) -> uint_t;
2966}
2967extern "C" {
2968 #[doc = " set minimum value of this parameter"]
2969 #[doc = ""]
2970 #[doc = "\\param param parameter, created by ::new_aubio_parameter"]
2971 #[doc = "\\param min_value new minimum value"]
2972 #[doc = ""]
2973 #[doc = "\\return 0 if successful, 1 otherwise"]
2974 pub fn aubio_parameter_set_min_value(
2975 param: *mut aubio_parameter_t,
2976 min_value: smpl_t,
2977 ) -> uint_t;
2978}
2979extern "C" {
2980 #[doc = " get minimum value of this parameter"]
2981 #[doc = ""]
2982 #[doc = "\\param param parameter, created by ::new_aubio_parameter"]
2983 #[doc = ""]
2984 #[doc = "\\return minimum value"]
2985 pub fn aubio_parameter_get_min_value(param: *const aubio_parameter_t) -> smpl_t;
2986}
2987extern "C" {
2988 #[doc = " set maximum value of this parameter"]
2989 #[doc = ""]
2990 #[doc = "\\param param parameter, created by ::new_aubio_parameter"]
2991 #[doc = "\\param max_value new maximum value"]
2992 #[doc = ""]
2993 #[doc = "\\return 0 if successful, 1 otherwise"]
2994 pub fn aubio_parameter_set_max_value(
2995 param: *mut aubio_parameter_t,
2996 max_value: smpl_t,
2997 ) -> uint_t;
2998}
2999extern "C" {
3000 #[doc = " get maximum value of this parameter"]
3001 #[doc = ""]
3002 #[doc = "\\param param parameter, created by ::new_aubio_parameter"]
3003 #[doc = ""]
3004 #[doc = "\\return maximum value"]
3005 pub fn aubio_parameter_get_max_value(param: *const aubio_parameter_t) -> smpl_t;
3006}
3007extern "C" {
3008 #[doc = " destroy ::aubio_parameter_t object"]
3009 #[doc = ""]
3010 #[doc = "\\param param parameter, created by ::new_aubio_parameter"]
3011 pub fn del_aubio_parameter(param: *mut aubio_parameter_t);
3012}
3013#[doc = "< critical errors"]
3014pub const aubio_log_level_AUBIO_LOG_ERR: aubio_log_level = 0;
3015#[doc = "< infos"]
3016pub const aubio_log_level_AUBIO_LOG_INF: aubio_log_level = 1;
3017#[doc = "< general messages"]
3018pub const aubio_log_level_AUBIO_LOG_MSG: aubio_log_level = 2;
3019#[doc = "< debug messages"]
3020pub const aubio_log_level_AUBIO_LOG_DBG: aubio_log_level = 3;
3021#[doc = "< warnings"]
3022pub const aubio_log_level_AUBIO_LOG_WRN: aubio_log_level = 4;
3023#[doc = "< number of valid levels"]
3024pub const aubio_log_level_AUBIO_LOG_LAST_LEVEL: aubio_log_level = 5;
3025#[doc = " list of logging levels"]
3026pub type aubio_log_level = ::std::os::raw::c_uint;
3027#[doc = " Logging function prototype, to be passed to ::aubio_log_set_function"]
3028#[doc = ""]
3029#[doc = "\\param level log level"]
3030#[doc = "\\param message text to log"]
3031#[doc = "\\param data optional closure used by the callback"]
3032#[doc = ""]
3033#[doc = "See @ref utils/test-log.c for an example of logging function."]
3034#[doc = ""]
3035pub type aubio_log_function_t = ::std::option::Option<
3036 unsafe extern "C" fn(level: sint_t, message: *const char_t, data: *mut ::std::os::raw::c_void),
3037>;
3038extern "C" {
3039 #[doc = " Set logging function for all levels"]
3040 #[doc = ""]
3041 #[doc = "\\param fun the function to be used to log, of type ::aubio_log_function_t"]
3042 #[doc = "\\param data optional closure to be passed to the function (can be NULL if"]
3043 #[doc = "nothing to pass)"]
3044 #[doc = ""]
3045 pub fn aubio_log_set_function(fun: aubio_log_function_t, data: *mut ::std::os::raw::c_void);
3046}
3047extern "C" {
3048 #[doc = " Set logging function for a given level"]
3049 #[doc = ""]
3050 #[doc = "\\param level the level for which to set the logging function"]
3051 #[doc = "\\param fun the function to be used to log, of type ::aubio_log_function_t"]
3052 #[doc = "\\param data optional closure to be passed to the function (can be NULL if"]
3053 #[doc = "nothing to pass)"]
3054 pub fn aubio_log_set_level_function(
3055 level: sint_t,
3056 fun: aubio_log_function_t,
3057 data: *mut ::std::os::raw::c_void,
3058 ) -> aubio_log_function_t;
3059}
3060extern "C" {
3061 #[doc = " Reset all logging functions to the default one"]
3062 #[doc = ""]
3063 #[doc = "After calling this function, the default logging function will be used to"]
3064 #[doc = "print error, warning, normal, and debug messages to `stdout` or `stderr`."]
3065 #[doc = ""]
3066 pub fn aubio_log_reset();
3067}