sherpa_rs_sys

Function SherpaOnnxOnlineStreamAcceptWaveform

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

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

@param stream A pointer returned by SherpaOnnxCreateOnlineStream(). @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.