sherpa_rs_sys

Function SherpaOnnxAcceptWaveformOffline

Source
pub unsafe extern "C" fn SherpaOnnxAcceptWaveformOffline(
    stream: *const SherpaOnnxOfflineStream,
    sample_rate: i32,
    samples: *const f32,
    n: i32,
)
Expand description

Accept input audio samples and compute the features. The user has to invoke SherpaOnnxDecodeOfflineStream() to run the neural network and decoding.

@param stream A pointer returned by SherpaOnnxCreateOfflineStream(). @param sample_rate Sample rate of the input samples. If it is different from config.feat_config.sample_rate, we will do resampling inside sherpa-onnx. @param samples A pointer to a 1-D array containing audio samples. The range of samples has to be normalized to [-1, 1]. @param n Number of elements in the samples array.

@caution: For each offline stream, please invoke this function only once!