sherpa-onnx C API 1.0
Public C API and C++ wrapper for sherpa-onnx
Loading...
Searching...
No Matches
sherpa_onnx::cxx::LinearResampler Class Reference

RAII wrapper for linear resampling. More...

#include <cxx-api.h>

Inheritance diagram for sherpa_onnx::cxx::LinearResampler:
Collaboration diagram for sherpa_onnx::cxx::LinearResampler:

Public Member Functions

 LinearResampler ()=default
 Construct an empty wrapper.
void Destroy (const SherpaOnnxLinearResampler *p) const
 Destroy the wrapped C handle.
void Reset () const
 Reset the resampler state.
std::vector< float > Resample (const float *input, int32_t input_dim, bool flush) const
 Resample one chunk of input audio.
int32_t GetInputSamplingRate () const
 Return the input sample rate in Hz.
int32_t GetOutputSamplingRate () const
 Return the output sample rate in Hz.
Public Member Functions inherited from sherpa_onnx::cxx::MoveOnly< LinearResampler, SherpaOnnxLinearResampler >
 MoveOnly ()=default
 Construct an empty wrapper.
 ~MoveOnly ()
 Destroy the wrapped handle if present.
MoveOnly & operator= (const MoveOnly &)=delete
const SherpaOnnxLinearResampler * Get () const
 Return the wrapped raw pointer without transferring ownership.
const SherpaOnnxLinearResampler * Release ()
 Release ownership of the wrapped raw pointer.

Static Public Member Functions

static LinearResampler Create (int32_t samp_rate_in_hz, int32_t samp_rate_out_hz, float filter_cutoff_hz, int32_t num_zeros)
 Create a linear resampler.

Additional Inherited Members

Protected Attributes inherited from sherpa_onnx::cxx::MoveOnly< LinearResampler, SherpaOnnxLinearResampler >
const SherpaOnnxLinearResampler * p_

Detailed Description

Definition at line 1792 of file cxx-api.h.

Constructor & Destructor Documentation

◆ LinearResampler()

sherpa_onnx::cxx::LinearResampler::LinearResampler ( )
default

Referenced by Create(), and GetOutputSamplingRate().

Member Function Documentation

◆ Create()

LinearResampler sherpa_onnx::cxx::LinearResampler::Create ( int32_t samp_rate_in_hz,
int32_t samp_rate_out_hz,
float filter_cutoff_hz,
int32_t num_zeros )
static

References LinearResampler().

◆ Destroy()

void sherpa_onnx::cxx::LinearResampler::Destroy ( const SherpaOnnxLinearResampler * p) const

◆ GetInputSamplingRate()

int32_t sherpa_onnx::cxx::LinearResampler::GetInputSamplingRate ( ) const

◆ GetOutputSamplingRate()

int32_t sherpa_onnx::cxx::LinearResampler::GetOutputSamplingRate ( ) const

References LinearResampler().

◆ Resample()

std::vector< float > sherpa_onnx::cxx::LinearResampler::Resample ( const float * input,
int32_t input_dim,
bool flush ) const

◆ Reset()

void sherpa_onnx::cxx::LinearResampler::Reset ( ) const

The documentation for this class was generated from the following file: