[−][src]Crate gaborator_sys
Gaborator is a C++ library for converting audio samples to a special spectral representation that uses different FTT sizes based on whether it is bass or treble (oversimplifying here). The transformation is reversible. See the website for more info.
This crate is a cxx-based wrapper of this library, allowing Rust code to use Gaborator (although with reduced efficiency).
Limitations:
f32
only- Not performance-minded
- Some overridable or low-level details not exposed
- No visualisation
- Crate soundness may be iffy - I was just followed the path of least resistance.
- Arithmentic overflows in buffer length calculations are not checked.
- No high-level API with methods.
- Not really tested, apart from included examples. For example, streaming should be supported, but I haven't tried it myself.
Currently based on Gaborator version 1.6. Source code of the Gaborator is included into the crate.
Availble examples:
- Phase information randomizer, creating sort-of-reverberation audio effect.
- Converts the analyzed sound to (sample,band,magnitude,phase) CSV file and back.
License of Gaborator is Affero GPL 3.0.
Glue code (sans doccomments copied from Gaborator) in this crate may be considered to be licensed as either MIT or AGPL-3.0, at your option.
Structs
Analyzer | Represents C++'s |
Coef | Complex point, representing one coefficient. Magnitude is loudness at this point, argument is phase. |
CoefMeta | Additional data for |
Coefs | Reprepresents C++'s |
Params | Corresponds to |
ProcessOrFillCallback | Wrapper for your callback function for |
Functions
analyze | Spectrum analyze the samples at |
band_ff | Return the center frequency of band number |
band_lowpass | Return the band number of the lowpass band. |
band_ref | Return the band number corresponding to the reference frequency |
bandpass_bands_begin | Return the smallest valid bandpass band number, corresponding to the highest-frequency bandpass filter. |
bandpass_bands_end | Return the bandpass band number one past the highest valid bandpass band number, corresponding to one past the lowest-frequency bandpass filter. |
create_coefs | Create |
fill | Write values to |
forget_before | Allow the coefficients for points in time before limit (a time in units of samples) to be forgotten. Streaming applications can use this to free memory used by coefficients that are no longer needed. Coefficients that have been forgotten will read as zero. This does not guarantee that all coefficients before limit are forgotten, only that ones for limit or later are not, and that the amount of memory consumed by any remaining coefficients before limit is bounded. |
get_analysis_support_len | Returns the one-sided worst-case time domain support of any of the analysis filters.
When calling |
get_synthesis_support_len | Returns the one-sided worst-case time domain support of any of the reconstruction filters. When calling synthesize() to synthesize a sample at time t, the sample will only be significantly affected by spectrogram coefficients in the time range t ± support. Coefficients outside the range may be used in the synthesis, but substituting zeroes for the actual coefficient values will not significantly reduce accuracy. |
new_analyzer | Create new instance of Gaborator analyzer/synthesizer based on supplied parameters |
process | Read or write values within |
synthesize | Synthesize signal samples from the coefficients |