Function libpd_rs::process::process_raw_double
source · [−]Expand description
Processes the non-interleaved f64 audio buffer in place through the loaded pd patch.
The processing order is like the following, input_buffer -> libpd -> output_buffer.
Copies buffer contents to/from libpd without striping.
Call this in your audio callback.
Examples
use libpd_rs::process::process_raw_double;
// After initializing audio and opening a patch file then in the audio callback..
// We can imagine that these are the buffers which has been handed to us by the audio callback.
let input_buffer = [0.0_f64; 512];
let mut output_buffer = [0.0_f64; 1024];
process_raw_double(&input_buffer, &mut output_buffer);
// Or if you wish,
// the input buffer can also be an empty slice if you're not going to use any inputs.
process_raw_double(&[], &mut output_buffer);Panics
This function may panic for multiple reasons, first of all there is a mutex lock used internally and also it processes buffers in place so there are possibilities of segfaults. Use with care.
