12 #ifndef ROC_AUDIO_SPEEX_RESAMPLER_H_
13 #define ROC_AUDIO_SPEEX_RESAMPLER_H_
29 #include <speex/speex_resampler.h>
55 virtual bool set_scaling(
size_t input_rate,
size_t output_rate,
float multiplier);
72 SpeexResamplerState* speex_state_;
75 const spx_uint32_t num_ch_;
79 spx_uint32_t in_frame_size_;
80 spx_uint32_t in_frame_pos_;
84 size_t initial_out_countdown_;
87 size_t initial_in_latency_;
92 ssize_t in_latency_diff_;
Sample specification. Describes sample rate and channels.
virtual void end_push_input()
Commit buffer with input data.
virtual bool is_valid() const
Check if object is successfully constructed.
virtual bool set_scaling(size_t input_rate, size_t output_rate, float multiplier)
Set new resample factor.
virtual size_t pop_output(sample_t *out_data, size_t out_size)
Read samples from input frame and fill output frame.
virtual const core::Slice< sample_t > & begin_push_input()
Get buffer to be filled with input data.
SpeexResampler(core::IArena &arena, FrameFactory &frame_factory, ResamplerProfile profile, const SampleSpec &in_spec, const SampleSpec &out_spec)
Initialize.
virtual float n_left_to_process() const
How many samples were pushed but not processed yet.
IArena & arena() const
Get arena.
Base class for non-copyable objects.
Audio resampler interface.
float sample_t
Raw audio sample.
ResamplerProfile
Resampler parameters presets.
Commonly used types and functions.
Various units used in packets.