本文整理汇总了C++中speex_resampler_destroy函数的典型用法代码示例。如果您正苦于以下问题:C++ speex_resampler_destroy函数的具体用法?C++ speex_resampler_destroy怎么用?C++ speex_resampler_destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了speex_resampler_destroy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wait
AudioInput::~AudioInput() {
bRunning = false;
wait();
speex_bits_destroy(&sbBits);
speex_encoder_destroy(esEncState);
mumble_drft_clear(&fftTable);
jitter_buffer_destroy(jb);
if (sppPreprocess)
speex_preprocess_state_destroy(sppPreprocess);
if (sesEcho)
speex_echo_state_destroy(sesEcho);
if (srsMic)
speex_resampler_destroy(srsMic);
if (srsEcho)
speex_resampler_destroy(srsEcho);
delete [] psMic;
delete [] psSpeaker;
delete [] psClean;
if (pfMicInput)
delete [] pfMicInput;
if (pfEchoInput)
delete [] pfEchoInput;
if (pfOutput)
delete [] pfOutput;
}
示例2: wait
AudioInput::~AudioInput() {
bRunning = false;
wait();
if (ceEncoder) {
cCodec->celt_encoder_destroy(ceEncoder);
} else if (esSpeex) {
speex_bits_destroy(&sbBits);
speex_encoder_destroy(esSpeex);
}
foreach(short *buf, qlEchoFrames)
delete [] buf;
if (sppPreprocess)
speex_preprocess_state_destroy(sppPreprocess);
if (sesEcho)
speex_echo_state_destroy(sesEcho);
if (srsMic)
speex_resampler_destroy(srsMic);
if (srsEcho)
speex_resampler_destroy(srsEcho);
delete [] psMic;
delete [] psClean;
delete [] psSpeaker;
delete [] pfMicInput;
delete [] pfEchoInput;
delete [] pfOutput;
}
示例3: wait
AudioInput::~AudioInput() {
bRunning = false;
wait();
#ifdef USE_OPUS
if (opusState)
opus_encoder_destroy(opusState);
#endif
if (ceEncoder) {
cCodec->celt_encoder_destroy(ceEncoder);
}
foreach(short *buf, qlEchoFrames)
delete [] buf;
if (sppPreprocess)
speex_preprocess_state_destroy(sppPreprocess);
if (sesEcho)
speex_echo_state_destroy(sesEcho);
if (srsMic)
speex_resampler_destroy(srsMic);
if (srsEcho)
speex_resampler_destroy(srsEcho);
delete [] psMic;
delete [] psClean;
delete [] psSpeaker;
delete [] pfMicInput;
delete [] pfEchoInput;
delete [] pfOutput;
}
示例4: stop
COggVorbisFileHelper::~COggVorbisFileHelper()
{
stop();
bStopDecoding = true;
while(mDecThread.thread_status == CThread::TRUNNING)
{
s3eDebugTracePrintf("waiting decoding thread terminating\n");
s3eDeviceYield(10);
}
if(mDecBuffer != NULL)
{
delete mDecBuffer;
mDecBuffer = NULL;
}
//cleanup();
if(res_contR) speex_resampler_destroy(res_contR);
if(res_contL) speex_resampler_destroy(res_contL);
delete [] iFilterBufferL;
delete [] iFilterBufferR;
delete [] dFilterCoefficients;
delete [] m_outL;
delete [] m_outR;
/*if(nStatus != OH_NAN) ov_clear(&vf);*/
}
示例5: g_free
RtpAudioStream::~RtpAudioStream()
{
for (int i = 0; i < rtp_packets_.size(); i++) {
rtp_packet_t *rtp_packet = rtp_packets_[i];
g_free(rtp_packet->info);
g_free(rtp_packet->payload_data);
g_free(rtp_packet);
}
g_hash_table_destroy(decoders_hash_);
if (audio_resampler_) speex_resampler_destroy (audio_resampler_);
speex_resampler_destroy (visual_resampler_);
}
示例6: kill_filter_audio
void kill_filter_audio(Filter_Audio *f_a)
{
if (!f_a) {
return;
}
WebRtcNsx_Free(f_a->noise_sup_x);
WebRtcAgc_Free(f_a->gain_control);
WebRtcAec_Free(f_a->echo_cancellation);
WebRtcVad_Free(f_a->Vad_handle);
speex_resampler_destroy(f_a->upsampler);
speex_resampler_destroy(f_a->downsampler);
speex_resampler_destroy(f_a->downsampler_echo);
free(f_a);
}
示例7: speex_resampler_destroy
void Resampler::destroyResampler()
{
if(NULL != resampler_){
speex_resampler_destroy(resampler_);
resampler_ = NULL;
}
}
示例8: AudioQualityImprovement_free
static void
AudioQualityImprovement_free(AudioQualityImprovement *aqi)
{
/* mutex */
Mutex_free(aqi->mutex);
/* preprocess */
if (aqi->preprocess)
speex_preprocess_state_destroy(aqi->preprocess);
/* echo */
if (aqi->echo)
speex_echo_state_destroy(aqi->echo);
/* out */
if (aqi->out)
free(aqi->out);
/* play */
if (aqi->play)
free(aqi->play);
/* resampler */
if (aqi->resampler)
speex_resampler_destroy(aqi->resampler);
/* stringID */
free(aqi->stringID);
free(aqi);
}
示例9: speex_resampler_destroy
Channel::~Channel()
{
if (resampler) {
speex_resampler_destroy(resampler);
resampler = 0;
}
}
示例10: Close
static void Close (vlc_object_t *obj)
{
filter_t *filter = (filter_t *)obj;
SpeexResamplerState *st = (SpeexResamplerState *)filter->p_sys;
speex_resampler_destroy (st);
}
示例11: speex_resampler_destroy
AudioOutputSample::~AudioOutputSample() {
if (srs)
speex_resampler_destroy(srs);
delete sfHandle;
sfHandle = NULL;
}
示例12: Native_NATIVE
JNIEXPORT void JNICALL Native_NATIVE(speex_1resampler_1destroy)
(JNIEnv *env, jclass that, jlong arg0)
{
Native_NATIVE_ENTER(env, that, Native_speex_1resampler_1destroy_FUNC);
speex_resampler_destroy((SpeexResamplerState *)(intptr_t)arg0);
Native_NATIVE_EXIT(env, that, Native_speex_1resampler_1destroy_FUNC);
}
示例13: rl_resampler_destroy
void rl_resampler_destroy( rl_resampler_t* resampler )
{
if ( resampler != (rl_resampler_t*)&passthrough )
{
speex_resampler_destroy( (SpeexResamplerState*)resampler );
}
}
示例14: ebur128_destroy_resampler
static void ebur128_destroy_resampler(ebur128_state* st) {
free(st->d->resampler_buffer_input);
st->d->resampler_buffer_input = NULL;
free(st->d->resampler_buffer_output);
st->d->resampler_buffer_output = NULL;
speex_resampler_destroy(st->d->resampler);
st->d->resampler = NULL;
}
示例15: ResamplePCM
bool ResamplePCM(uint32 NumChannels, const TArray<uint8>& InBuffer, uint32 InSampleRate, TArray<uint8>& OutBuffer, uint32 OutSampleRate) const
{
// Initialize resampler to convert to desired rate for Opus
int32 err = 0;
SpeexResamplerState* resampler = speex_resampler_init(NumChannels, InSampleRate, OutSampleRate, SPEEX_RESAMPLER_QUALITY_DESKTOP, &err);
if (err != RESAMPLER_ERR_SUCCESS)
{
speex_resampler_destroy(resampler);
return false;
}
// Calculate extra space required for sample rate
const uint32 SampleStride = SAMPLE_SIZE * NumChannels;
const float Duration = (float)InBuffer.Num() / (InSampleRate * SampleStride);
const int32 SafeCopySize = (Duration + 1) * OutSampleRate * SampleStride;
OutBuffer.Empty(SafeCopySize);
OutBuffer.AddUninitialized(SafeCopySize);
uint32 InSamples = InBuffer.Num() / SampleStride;
uint32 OutSamples = OutBuffer.Num() / SampleStride;
// Do resampling and check results
if (NumChannels == 1)
{
err = speex_resampler_process_int(resampler, 0, (const short*)(InBuffer.GetData()), &InSamples, (short*)(OutBuffer.GetData()), &OutSamples);
}
else
{
err = speex_resampler_process_interleaved_int(resampler, (const short*)(InBuffer.GetData()), &InSamples, (short*)(OutBuffer.GetData()), &OutSamples);
}
speex_resampler_destroy(resampler);
if (err != RESAMPLER_ERR_SUCCESS)
{
return false;
}
// reduce the size of Out Buffer if more space than necessary was allocated
const int32 WrittenBytes = (int32)(OutSamples * SampleStride);
if (WrittenBytes < OutBuffer.Num())
{
OutBuffer.SetNum(WrittenBytes, true);
}
return true;
}