bliss_audio_aubio_rs/lib.rs
1/*!
2 * # Safe bindings for _aubio_ library
3 *
4 * > _Aubio_ is a library to label music and sounds.
5 * >
6 * > It listens to audio signals and attempts to detect events.
7 * > For instance, when a drum is hit, at which frequency is a note,
8 * > or at what tempo is a rhythmic melody.
9 * >
10 * > Its features include segmenting a sound file before each of its attacks,
11 * > performing pitch detection, tapping the beat and producing midi streams
12 * > from live audio.
13 * >
14 * > aubio provide several algorithms and routines, including:
15 * >
16 * > * several onset detection methods
17 * > * different pitch detection methods
18 * > * tempo tracking and beat detection
19 * > * MFCC (mel-frequency cepstrum coefficients)
20 * > * FFT and phase vocoder
21 * > * up/down-sampling
22 * > * digital filters (low pass, high pass, and more)
23 * > * spectral filtering
24 * > * transient/steady-state separation
25 * > * sound file read and write access
26 * > * various mathematics utilities for music applications
27 * >
28 * > The name _aubio_ comes from audio with a typo: some errors are likely
29 * > to be found in the results.
30 *
31 * ## Crate features
32 *
33 * The following features can be used to customize configuration:
34 *
35 * - __bindgen__ Force generate bindings itself instead of use pre-generated (_useful for unsupported archs_)
36 * - __builtin__ Force compile builtin _aubio_ C-library
37 * - __pkg-config__ Use _pkg-config_ to find installed libraries
38 * - __shared__ Build shared _aubio_ C-library
39 * - __static__ Build static _aubio_ C-library
40 * - __fftw3__ Enable using _fftw3_ library
41 *
42 * When __pkg-config__ feature is used the installed __aubio__ library will be used if found.
43 * To force build and link builtin version you can use __builtin__ feature.
44 */
45
46pub(crate) use bliss_audio_aubio_sys as ffi;
47
48mod fft;
49mod filterbank;
50mod log;
51mod mfcc;
52mod notes;
53mod onset;
54mod pitch;
55mod pvoc;
56mod resampler;
57mod specdesc;
58mod tempo;
59mod types;
60mod utils;
61mod winfunc;
62
63pub mod vec;
64
65pub use self::fft::*;
66pub use self::filterbank::*;
67pub use self::log::*;
68pub use self::mfcc::*;
69pub use self::notes::*;
70pub use self::onset::*;
71pub use self::pitch::*;
72pub use self::pvoc::*;
73pub use self::resampler::*;
74pub use self::specdesc::*;
75pub use self::tempo::*;
76pub use self::types::*;
77pub use self::utils::*;
78pub use self::winfunc::*;
79
80/**
81 * Sample data type
82 */
83pub type Smpl = ffi::smpl_t;
84
85#[macro_export]
86macro_rules! farr {
87 ($len: expr) => {
88 [0. as $crate::Smpl; $len]
89 };
90}
91
92#[macro_export]
93macro_rules! carr {
94 ($len: expr) => {
95 [0. as $crate::Smpl; $len + 2]
96 };
97}