本文整理汇总了C++中speex_resampler_destroy函数的典型用法代码示例。如果您正苦于以下问题:C++ speex_resampler_destroy函数的具体用法?C++ speex_resampler_destroy怎么用?C++ speex_resampler_destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了speex_resampler_destroy函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:ArminW,项目名称:re-whisper,代码行数:29,代码来源:AudioInput.cpp
示例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;
}
开发者ID:ashurta,项目名称:mumble,代码行数:32,代码来源:AudioInput.cpp
示例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;
}
开发者ID:AceXare,项目名称:mumble,代码行数:34,代码来源:AudioInput.cpp
示例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);*/
}
开发者ID:arf-it,项目名称:marmalade-libvorbis,代码行数:30,代码来源:oggHelper.cpp
示例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_);
}
开发者ID:DHODoS,项目名称:wireshark,代码行数:12,代码来源:rtp_audio_stream.cpp
示例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);
}
开发者ID:isotoxin,项目名称:filter_audio,代码行数:15,代码来源:filter_audio.c
示例7: speex_resampler_destroy
void Resampler::destroyResampler()
{
if(NULL != resampler_){
speex_resampler_destroy(resampler_);
resampler_ = NULL;
}
}
开发者ID:taqu,项目名称:opus,代码行数:7,代码来源:Resampler.cpp
示例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);
}
开发者ID:AlertMe,项目名称:java-bells,代码行数:25,代码来源:AudioQualityImprovement.c
示例9: speex_resampler_destroy
Channel::~Channel()
{
if (resampler) {
speex_resampler_destroy(resampler);
resampler = 0;
}
}
开发者ID:Achilleshiel,项目名称:OpenRCT2,代码行数:7,代码来源:mixer.cpp
示例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);
}
开发者ID:Aki-Liang,项目名称:vlc-2.1.0.oldlib-2010,代码行数:7,代码来源:speex.c
示例11: speex_resampler_destroy
AudioOutputSample::~AudioOutputSample() {
if (srs)
speex_resampler_destroy(srs);
delete sfHandle;
sfHandle = NULL;
}
开发者ID:EarlOfWenc,项目名称:mumble,代码行数:7,代码来源:AudioOutputSample.cpp
示例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);
}
开发者ID:Arestin,项目名称:mumble-android,代码行数:7,代码来源:hawtjni_native.c
示例13: rl_resampler_destroy
void rl_resampler_destroy( rl_resampler_t* resampler )
{
if ( resampler != (rl_resampler_t*)&passthrough )
{
speex_resampler_destroy( (SpeexResamplerState*)resampler );
}
}
开发者ID:Feufochmar,项目名称:libretro-lutro,代码行数:7,代码来源:rl_resample.c
示例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;
}
开发者ID:andrewrk,项目名称:libebur128,代码行数:8,代码来源:ebur128.c
示例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;
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:45,代码来源:AudioFormatOpus.cpp
示例16: speex_resampler_destroy
void AudioInput::initializeMixer() {
int err;
if (srsMic)
speex_resampler_destroy(srsMic);
if (srsEcho)
speex_resampler_destroy(srsEcho);
if (pfMicInput)
delete [] pfMicInput;
if (pfEchoInput)
delete [] pfEchoInput;
if (pfOutput)
delete [] pfOutput;
if (iMicFreq != iSampleRate)
srsMic = speex_resampler_init(1, iMicFreq, iSampleRate, 3, &err);
iMicLength = (iFrameSize * iMicFreq) / iSampleRate;
pfMicInput = new float[iMicLength];
pfOutput = new float[iFrameSize * max(1U,iEchoChannels)];
if (iEchoChannels > 0) {
bEchoMulti = g_struct.s.bEchoMulti;
if (iEchoFreq != iSampleRate)
srsEcho = speex_resampler_init(bEchoMulti ? iEchoChannels : 1, iEchoFreq, iSampleRate, 3, &err);
iEchoLength = (iFrameSize * iEchoFreq) / iSampleRate;
iEchoMCLength = bEchoMulti ? iEchoLength * iEchoChannels : iEchoLength;
iEchoFrameSize = bEchoMulti ? iFrameSize * iEchoChannels : iFrameSize;
pfEchoInput = new float[iEchoMCLength];
} else {
srsEcho = NULL;
pfEchoInput = NULL;
}
imfMic = chooseMixer(iMicChannels, eMicFormat);
imfEcho = chooseMixer(iEchoChannels, eEchoFormat);
iMicSampleSize = static_cast<int>(iMicChannels * ((eMicFormat == SampleFloat) ? sizeof(float) : sizeof(short)));
iEchoSampleSize = static_cast<int>(iEchoChannels * ((eEchoFormat == SampleFloat) ? sizeof(float) : sizeof(short)));
bResetProcessor = true;
Trace("AudioInput: Initialized mixer for %d channel %d hz mic and %d channel %d hz echo", iMicChannels, iMicFreq, iEchoChannels, iEchoFreq);
}
开发者ID:fffonion,项目名称:V8,代码行数:45,代码来源:AudioInput.cpp
示例17: ttLibC_SpeexdspResampler_close
/*
* close resampler.
* @param resampler
*/
void ttLibC_SpeexdspResampler_close(ttLibC_SpeexdspResampler **resampler) {
ttLibC_SpeexdspResampler_ *target = (ttLibC_SpeexdspResampler_ *)*resampler;
if(target == NULL) {
return;
}
speex_resampler_destroy(target->resampler);
ttLibC_free(target);
*resampler = NULL;
}
开发者ID:taktod,项目名称:ttLibC,代码行数:13,代码来源:speexdspResampler.c
示例18: defined
AudioResampler::~AudioResampler() {
if (conversion_state) {
#if defined(HAVE_LIBSPEEXDSP)
speex_resampler_destroy(conversion_state);
#elif defined(HAVE_LIBSAMPLERATE)
src_delete(conversion_state);
#endif
}
}
开发者ID:EasyRPG,项目名称:Player,代码行数:9,代码来源:audio_resampler.cpp
示例19: if
AudioInput::~AudioInput() {
g_pWaveFile.Close();
bRunning = false;
if (ceEncoder) {
cCodec->encoder_destroy(ceEncoder);
} else if (esSpeex) {
speex_bits_destroy(&sbBits);
speex_encoder_destroy(esSpeex);
}
// mumble_drft_clear(&fftTable);
std::deque<short*>::iterator dit;
for (dit = qlEchoFrames.begin(); dit != qlEchoFrames.end();)
{
delete [] *dit;
dit = qlEchoFrames.erase(dit);
}
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;
if (psSpeaker)
delete [] psSpeaker;
if (pfMicInput)
delete [] pfMicInput;
if (pfEchoInput)
delete [] pfEchoInput;
if (pfOutput)
delete [] pfOutput;
}
开发者ID:fffonion,项目名称:V8,代码行数:44,代码来源:AudioInput.cpp
示例20: resample_process_ms2
static void resample_process_ms2(MSFilter *obj) {
ResampleData *dt=(ResampleData*)obj->data;
mblk_t *m;
if (dt->output_rate==dt->input_rate) {
while((m=ms_queue_get(obj->inputs[0]))!=NULL) {
ms_queue_put(obj->outputs[0],m);
}
return;
}
ms_filter_lock(obj);
if (dt->handle!=NULL) {
unsigned int inrate=0, outrate=0;
speex_resampler_get_rate(dt->handle,&inrate,&outrate);
if (inrate!=dt->input_rate || outrate!=dt->output_rate) {
speex_resampler_destroy(dt->handle);
dt->handle=0;
}
}
if (dt->handle==NULL) {
int err=0;
dt->handle=speex_resampler_init(dt->nchannels, dt->input_rate, dt->output_rate, SPEEX_RESAMPLER_QUALITY_VOIP, &err);
}
while((m=ms_queue_get(obj->inputs[0]))!=NULL) {
unsigned int inlen=(m->b_wptr-m->b_rptr)/(2*dt->nchannels);
unsigned int outlen=((inlen*dt->output_rate)/dt->input_rate)+1;
unsigned int inlen_orig=inlen;
mblk_t *om=allocb(outlen*2*dt->nchannels,0);
if (dt->nchannels==1) {
speex_resampler_process_int(dt->handle,
0,
(int16_t*)m->b_rptr,
&inlen,
(int16_t*)om->b_wptr,
&outlen);
} else {
speex_resampler_process_interleaved_int(dt->handle,
(int16_t*)m->b_rptr,
&inlen,
(int16_t*)om->b_wptr,
&outlen);
}
if (inlen_orig!=inlen) {
ms_error("Bug in resampler ! only %u samples consumed instead of %u, out=%u",
inlen,inlen_orig,outlen);
}
om->b_wptr+=outlen*2*dt->nchannels;
mblk_set_timestamp_info(om,dt->ts);
dt->ts+=outlen;
ms_queue_put(obj->outputs[0],om);
freemsg(m);
}
ms_filter_unlock(obj);
}
开发者ID:jiwang0042,项目名称:linphone-vs2008,代码行数:56,代码来源:msresample.c
注:本文中的speex_resampler_destroy函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论