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 (const SherpaOnnxLinearResampler *p)
 Construct a wrapper from a raw C handle.
 
 MoveOnly (const MoveOnly &)=delete
 
 MoveOnly (MoveOnly &&other)
 
 ~MoveOnly ()
 Destroy the wrapped handle if present.
 
MoveOnlyoperator= (const MoveOnly &)=delete
 
MoveOnlyoperator= (MoveOnly &&other)
 
const SherpaOnnxLinearResamplerGet () const
 Return the wrapped raw pointer without transferring ownership.
 
const SherpaOnnxLinearResamplerRelease ()
 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 SherpaOnnxLinearResamplerp_
 

Detailed Description

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

Constructor & Destructor Documentation

◆ LinearResampler()

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

Member Function Documentation

◆ Create()

static 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

◆ 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

◆ 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: