[][src]Function aubio_sys::aubio_onset_do

pub unsafe extern "C" fn aubio_onset_do(
    o: *mut aubio_onset_t,
    input: *const fvec_t,
    onset: *mut fvec_t
)

execute onset detection

\param o onset detection object as returned by new_aubio_onset() \param input new audio vector of length hop_size \param onset output vector of length 1, containing 0 if no onset was found, and a value equal or greater than 1 otherwise

When no onset was detected, the first element of the output vector onset is set to 0.

When an onset is found, the first element of the output vector onset is set to offset = 1 + a where a is a number in the range[0, 1].

The final onset detection time, in samples, can be obtained with aubio_onset_get_last(). It can also be derived from offset as follows:

\code t = total_frames + offset * hop_size - delay \endcode

where total_frames is the total number of frames processed so far, and delay is the current delay of the onset object, as returned by aubio_onset_get_delay().