9 #ifndef _MpResamplerSpeex_h_ 10 #define _MpResamplerSpeex_h_ 12 #if defined(HAVE_SPEEX) || defined(HAVE_SPEEX_RESAMPLER) 18 #include <os/OsStatus.h> 31 typedef struct SpeexResamplerState_ SpeexResamplerState;
45 MpResamplerSpeex(uint32_t numChannels,
48 int32_t quality = -1);
77 OsStatus
resample(uint32_t channelIndex,
80 uint32_t& inSamplesProcessed,
82 uint32_t outBufLength,
83 uint32_t& outSamplesWritten);
91 uint32_t& inSamplesProcessed,
93 uint32_t outBufLength,
94 uint32_t& outSamplesWritten);
138 OsStatus speexErrToOsStatus(
int speexErr);
141 SpeexResamplerState* mpState;
148 #endif // _MpResamplerSpeex_h_ Generic audio resampler.
Definition: MpResampler.h:34
virtual OsStatus resampleInterleavedStereo(const MpAudioSample *pInBuf, uint32_t inBufLength, uint32_t &inSamplesProcessed, MpAudioSample *pOutBuf, uint32_t outBufLength, uint32_t &outSamplesWritten)
Resample interleaved stereo audio data.
Definition: MpResampler.cpp:129
virtual OsStatus resample(uint32_t channelIndex, const MpAudioSample *pInBuf, uint32_t inBufLength, uint32_t &inSamplesProcessed, MpAudioSample *pOutBuf, uint32_t outBufLength, uint32_t &outSamplesWritten)
Resample audio data coming from the specified channel.
Definition: MpResampler.cpp:72
virtual OsStatus setOutputRate(const uint32_t outputRate)
Set the output sample rate, in Hz.
Definition: MpResampler.cpp:228
virtual OsStatus resetStream()
Reset resampler state to prepare for processing new (unrelated) stream.
Definition: MpResampler.cpp:65
int16_t MpAudioSample
Definition: MpTypes.h:44
virtual OsStatus setInputRate(const uint32_t inputRate)
Set the input sample rate, in Hz.
Definition: MpResampler.cpp:222
virtual OsStatus setQuality(const int32_t quality)
Set the quality of resampling conversion.
Definition: MpResampler.cpp:234