Closed Flocksserver closed 3 years ago
@Flocksserver Thanks for interest to this bindings. This little bit far to completion especially in aspect of docs and examples.
The types FVec
and FVecMut
wraps slices of Rust's f32
to use as an aubio's fvec_t
type to transfer audio data.
The aubio
's APIs operates with sample buffers. So you should read some number of audio samples to memory buffer (for ex. Vec<f32>
) first. For offline (non-realtime) conversion I recommend use buffers as large as possible to get the maximum performance with reasonable RAM usage.
The N
means the input buffer size in samples. Say you want to resample the buffer which contains 33 samples from 48000Hz to 44100Hz. In that case you must provide output buffer to write at least 30 samples ((33.0 * 44100.0 / 48000.0).floor()
).
Ok that makes sense! Thanks for the explanation.
Hey, first of all thanks you for your work.
I am a bit confused about how to use some parts of your lib.
For example: I would like to resample some wav files. But I don't know which parameters I have use to call the function
do_
.do_
takes structs from your library. One can construct them by callingFVec::from
andFVecMut::from
but I have aBufReader<File>
as input and what as output? And how to pass/convert aBufReader<File>
to[f32]
Maybe my question is stupid - but it would be really nice if you support me.
In general it would be a massiv improvement to have more examples :) Best :)