您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ speex_bits_destroy函数代码示例

51自学网 2021-06-03 08:08:55
  C++
这篇教程C++ speex_bits_destroy函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中speex_bits_destroy函数的典型用法代码示例。如果您正苦于以下问题:C++ speex_bits_destroy函数的具体用法?C++ speex_bits_destroy怎么用?C++ speex_bits_destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了speex_bits_destroy函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: switch_speex_destroy

static switch_status_t switch_speex_destroy(switch_codec_t *codec){	int encoding, decoding;	struct speex_context *context = codec->private_info;	if (!context) {		return SWITCH_STATUS_FALSE;	}	encoding = (codec->flags & SWITCH_CODEC_FLAG_ENCODE);	decoding = (codec->flags & SWITCH_CODEC_FLAG_DECODE);	if (encoding) {		speex_bits_destroy(&context->encoder_bits);		speex_encoder_destroy(context->encoder_state);	}	if (decoding) {		speex_bits_destroy(&context->decoder_bits);		speex_decoder_destroy(context->decoder_state);	}	codec->private_info = NULL;	return SWITCH_STATUS_SUCCESS;}
开发者ID:AbrahamJewowich,项目名称:FreeSWITCH,代码行数:26,


示例2: voice_close

void voice_close(){	if (voice_fd != -1) {		close(voice_fd);		voice_fd = -1;	}#if HAVE_GSM	if (voice_gsm_dec) {		gsm_destroy(voice_gsm_dec);		voice_gsm_dec = NULL;	}	if (voice_gsm_enc) {		gsm_destroy(voice_gsm_enc);		voice_gsm_enc = NULL;	}#endif#if HAVE_SPEEX	if (voice_speex_enc) {		speex_encoder_destroy(voice_speex_enc);		voice_speex_enc = NULL;		speex_bits_destroy(&speex_enc_bits);	}	if (voice_speex_dec) {		speex_decoder_destroy(voice_speex_dec);		voice_speex_dec = NULL;		speex_bits_destroy(&speex_dec_bits);	}#endif}
开发者ID:canthar,项目名称:libgadu,代码行数:33,


示例3: tdav_codec_speex_deinit

int tdav_codec_speex_deinit(tdav_codec_speex_t* self){	if(self){		if(self->decoder.state){			speex_decoder_destroy(self->decoder.state);			self->decoder.state = tsk_null;		}		speex_bits_destroy(&self->decoder.bits);		if(self->decoder.buffer){			TSK_FREE(self->decoder.buffer);			self->decoder.size = 0;		}		if(self->encoder.state){			speex_encoder_destroy(self->encoder.state);			self->encoder.state = tsk_null;		}		speex_bits_destroy(&self->encoder.bits);		self->encoder.size = 0;				return 0;	}	else{		TSK_DEBUG_ERROR("Invalid parameter");		return -1;	}}
开发者ID:SayCV,项目名称:doubango,代码行数:27,


示例4: Java_com_mogujie_tt_support_audio_Speex_close

extern "C" JNIEXPORT void JNICALL Java_com_mogujie_tt_support_audio_Speex_close(		JNIEnv *env, jobject obj) {	if (--codec_open != 0)		return;	speex_bits_destroy(&ebits);	speex_bits_destroy(&dbits);	speex_decoder_destroy(dec_state);	speex_encoder_destroy(enc_state);}
开发者ID:10045125,项目名称:TTAndroidClient,代码行数:11,


示例5: Java_com_haitou_xiaoyoupai_imservice_support_audio_Speex_close

extern "C" JNIEXPORT void JNICALL Java_com_haitou_xiaoyoupai_imservice_support_audio_Speex_close(    JNIEnv *env, jobject obj) {    if (--codec_open != 0)        return;    speex_bits_destroy(&ebits);    speex_bits_destroy(&dbits);    speex_decoder_destroy(dec_state);    speex_encoder_destroy(enc_state);}
开发者ID:treejames,项目名称:FreshMAn-Task,代码行数:11,


示例6: speex_bits_destroy

JNIEXPORT void JNICALL Java_com_speex_encode_Speex_close    (JNIEnv *env, jobject obj) {	if (--codec_open != 0)		return;	speex_bits_destroy(&ebits);	speex_bits_destroy(&dbits);	speex_decoder_destroy(dec_state); 	speex_encoder_destroy(enc_state); }
开发者ID:xuechinahb,项目名称:langs,代码行数:11,


示例7: qSpeexDestroyHandle

void qSpeexDestroyHandle(QSpeexCodecPtr handle){	if (!handle) return;		speex_encoder_destroy(handle->encState);	speex_decoder_destroy(handle->decState);		speex_bits_destroy(&handle->encBits);	speex_bits_destroy(&handle->decBits);		speex_jitter_destroy(&handle->jitter);		free(handle);}
开发者ID:JupiterSmalltalk,项目名称:openqwaq,代码行数:14,


示例8: 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,


示例9: main

int main(int argc, char **argv){   char *outFile;   FILE *fout;   /*Holds the audio that will be written to file (16 bits per sample)*/   short out[FRAME_SIZE];   /*Speex handle samples as float, so we need an array of floats*/   float output[FRAME_SIZE];   char cbits[200];   int nbBytes;   /*Holds the state of the decoder*/   void *state;   /*Holds bits so they can be read and written to by the Speex routines*/   SpeexBits bits;   int i, tmp;   /*Create a new decoder state in narrowband mode*/   state = speex_decoder_init(&speex_nb_mode);   /*Set the perceptual enhancement on*/   tmp=1;   speex_decoder_ctl(state, SPEEX_SET_ENH, &tmp);   outFile = argv[1];   fout = fopen(outFile, "w");   /*Initialization of the structure that holds the bits*/   speex_bits_init(&bits);   while (1)   {      /*Read the size encoded by sampleenc, this part will likely be        different in your application*/      fread(&nbBytes, sizeof(int), 1, stdin);      fprintf (stderr, "nbBytes: %d/n", nbBytes);      if (feof(stdin))         break;      /*Read the "packet" encoded by sampleenc*/      fread(cbits, 1, nbBytes, stdin);      /*Copy the data into the bit-stream struct*/      speex_bits_read_from(&bits, cbits, nbBytes);      /*Decode the data*/      speex_decode(state, &bits, output);      /*Copy from float to short (16 bits) for output*/      for (i=0;i<FRAME_SIZE;i++)         out[i]=output[i];      /*Write the decoded audio to file*/      fwrite(out, sizeof(short), FRAME_SIZE, fout);   }   /*Destroy the decoder state*/   speex_decoder_destroy(state);   /*Destroy the bit-stream truct*/   speex_bits_destroy(&bits);   fclose(fout);   return 0;}
开发者ID:Distrotech,项目名称:speex,代码行数:60,


示例10: decoder_error_init

static struct spx_data *spx_open_internal (struct io_stream *stream){	struct spx_data *data;	SpeexStereoState stereo = SPEEX_STEREO_STATE_INIT;	data = (struct spx_data *)xmalloc (sizeof(struct spx_data));	decoder_error_init (&data->error);	data->stream = stream;	data->st = NULL;	data->stereo = stereo;	data->header = NULL;	data->output = NULL;	data->comment_packet = NULL;	data->bitrate = -1;	ogg_sync_init (&data->oy);	speex_bits_init (&data->bits);	if (!read_speex_header(data)) {		ogg_sync_clear (&data->oy);		speex_bits_destroy (&data->bits);		data->ok = 0;	}	else		data->ok = 1;	return data;}
开发者ID:jonsafari,项目名称:mocp,代码行数:29,


示例11: destroy_speex_decoder

void destroy_speex_decoder() {    if (gDecoderState != NULL) {        speex_decoder_destroy(gDecoderState);        speex_bits_destroy(&gDecoderBits);        gDecoderState = NULL;    }}
开发者ID:Aleph-One-Marathon,项目名称:alephone-psp,代码行数:7,


示例12: encode_speex

static int encode_speex(int16_t * input_frame, uint8_t nbframes, char * output, int bitrate) {	int i, bytesToWrite, nbBytes;  SpeexBits bits;  void * state;  long long total;  speex_bits_init(&bits);  state = speex_encoder_init(&speex_nb_mode);  speex_encoder_ctl(state, SPEEX_SET_QUALITY, &bitrate);  speex_bits_reset(&bits);    total = 0;  for(i=0;i<5*160;i++) {    total += input_frame[i];  }  total /= (5*160);  if(abs(total) < 10)    return 0;  for(i=0;i<5;i++) {	  speex_encode_int(state, input_frame + (i*160), &bits);  }	bytesToWrite = speex_bits_nbytes(&bits);  nbBytes = speex_bits_write(&bits, output, bytesToWrite);  speex_bits_destroy(&bits);  speex_decoder_destroy(state);	return nbBytes;}
开发者ID:Youx,项目名称:soliloque-client,代码行数:29,


示例13: speextolin_destroy

static void speextolin_destroy(struct ast_trans_pvt *arg){	struct speex_coder_pvt *pvt = arg->pvt;	speex_decoder_destroy(pvt->speex);	speex_bits_destroy(&pvt->bits);}
开发者ID:mtulio,项目名称:mtulio,代码行数:7,


示例14: gst_speex_dec_reset

static voidgst_speex_dec_reset (GstSpeexDec * dec){  dec->packetno = 0;  dec->frame_size = 0;  dec->frame_duration = 0;  dec->mode = NULL;  free (dec->header);  dec->header = NULL;  speex_bits_destroy (&dec->bits);  speex_bits_set_bit_buffer (&dec->bits, NULL, 0);  gst_buffer_replace (&dec->streamheader, NULL);  gst_buffer_replace (&dec->vorbiscomment, NULL);  if (dec->stereo) {    speex_stereo_state_destroy (dec->stereo);    dec->stereo = NULL;  }  if (dec->state) {    speex_decoder_destroy (dec->state);    dec->state = NULL;  }}
开发者ID:pexip,项目名称:gst-plugins-good,代码行数:25,


示例15: 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,


示例16: decode_destructor

static void decode_destructor(void *arg){	struct audec_state *st = arg;	speex_bits_destroy(&st->bits);	speex_decoder_destroy(st->dec);}
开发者ID:FOSSRIT,项目名称:baresip,代码行数:7,


示例17: encode_destructor

static void encode_destructor(void *arg){	struct auenc_state *st = arg;	speex_bits_destroy(&st->bits);	speex_encoder_destroy(st->enc);}
开发者ID:FOSSRIT,项目名称:baresip,代码行数:7,


示例18: main

int main(int argc, char **argv){   char *inFile;   FILE *fin;   short in[FRAME_SIZE];   float input[FRAME_SIZE];   char cbits[2000];   int nbBytes;   /*Holds the state of the encoder*/   void *state;   /*Holds bits so they can be read and written to by the Speex routines*/   SpeexBits bits;   int i, tmp;   /*Create a new encoder state in narrowband mode*/   state = speex_encoder_init(&speex_nb_mode);   //printf("inited/n");   /*Set the quality to 8 (15 kbps)*/   tmp=8;   speex_encoder_ctl(state, SPEEX_SET_QUALITY, &tmp);   inFile = argv[1];   fin = fopen(inFile, "r");   /*Initialization of the structure that holds the bits*/   speex_bits_init(&bits);   while (1)   {      /*Read a 16 bits/sample audio frame*/      fread(in, sizeof(short), FRAME_SIZE, fin);      if (feof(fin))         break;      /*Copy the 16 bits values to float so Speex can work on them*/      for (i=0;i<FRAME_SIZE;i++)         input[i]=in[i];      /*Flush all the bits in the struct so we can encode a new frame*/      speex_bits_reset(&bits);      /*Encode the frame*/      speex_encode(state, input, &bits);      /*Copy the bits to an array of char that can be written*/      nbBytes = speex_bits_write(&bits, cbits, 2000);      /*Write the size of the frame first. This is what sampledec expects but       it's likely to be different in your own application*/      fwrite(&nbBytes, sizeof(int), 1, stdout);      /*Write the compressed data*/      fwrite(cbits, 1, nbBytes, stdout);         }      /*Destroy the encoder state*/   speex_encoder_destroy(state);   /*Destroy the bit-packing struct*/   speex_bits_destroy(&bits);   fclose(fin);   return 0;}
开发者ID:kaainet,项目名称:smart_bus_proto,代码行数:59,


示例19: speex_encoder_destroy

void SpeexEncoder::Close(){	speex_encoder_destroy(st);	speex_bits_destroy(&bits);	ogg_stream_clear(&os);	fclose(fout);	closed = true;}
开发者ID:MarcoMedrano,项目名称:speexsharp,代码行数:8,


示例20: codec_drv_stop

static void codec_drv_stop(ErlDrvData handle){	codec_data *d = (codec_data *) handle;	speex_bits_destroy(&d->bits);	speex_encoder_destroy(d->estate);	speex_decoder_destroy(d->dstate);	driver_free((char*)handle);}
开发者ID:LeoKudrik,项目名称:rtplib,代码行数:8,


示例21: FUNCSPEEX

JNIEXPORT void JNICALL FUNCSPEEX(releaseDecode)(JNIEnv* env, jobject obj) {	speex_bits_destroy(&dbits);	if (dec_state != NULL) {		speex_decoder_destroy(dec_state);		dec_state = NULL;	}}
开发者ID:hihua,项目名称:hihuacode,代码行数:8,


示例22: speex_destroy

void speex_destroy(long handle){  SpeexState* ss = (SpeexState*) handle;      DBG("SpeexDestroy for handle %ld/n", handle);      if (!ss)    return;      speex_encoder_destroy(ss->encoder.state);  speex_bits_destroy(&ss->encoder.bits);      speex_decoder_destroy(ss->decoder.state);  speex_bits_destroy(&ss->decoder.bits);      free(ss);}
开发者ID:Chocolatbuddha,项目名称:sems,代码行数:17,


示例23: libspeex_decode_close

static av_cold int libspeex_decode_close(AVCodecContext *avctx){    LibSpeexContext *s = avctx->priv_data;    speex_bits_destroy(&s->bits);    speex_decoder_destroy(s->dec_state);    return 0;}
开发者ID:zhanjx1314,项目名称:vc-ffmpeg2,代码行数:9,


示例24: speex_decode_close

static int speex_decode_close(AVCodecContext *avctx){    SpeexContext *s = avctx->priv_data;    speex_decoder_destroy(s->st);    speex_bits_destroy(&s->bits);    return 0;}
开发者ID:paranojik,项目名称:multitv,代码行数:9,


示例25: lintospeex_destroy

static void lintospeex_destroy(struct ast_trans_pvt *arg){	struct speex_coder_pvt *pvt = arg->pvt;#ifdef _SPEEX_TYPES_H	if (preproc)		speex_preprocess_state_destroy(pvt->pp);#endif	speex_encoder_destroy(pvt->speex);	speex_bits_destroy(&pvt->bits);}
开发者ID:mtulio,项目名称:mtulio,代码行数:10,


示例26: uninit

static void uninit(sh_audio_t *sh) {  context_t *ctx = sh->context;  if (ctx) {    speex_bits_destroy(&ctx->bits);    speex_decoder_destroy(ctx->dec_context);    free(ctx->hdr);    free(ctx);  }  ctx = NULL;}
开发者ID:Gamer125,项目名称:wiibrowser,代码行数:10,


示例27: spx_destroy

int spx_destroy(int handle ){    speex_encode_union_t * speex_encode_u = (speex_encode_union_t *)handle;    /*Destroy the encoder state*/	speex_encoder_destroy(speex_encode_u->state);	/*Destroy the bit-packing struct*/	speex_bits_destroy(&speex_encode_u->bits);	free(speex_encode_u);}
开发者ID:chris-magic,项目名称:libspeex-study,代码行数:10,


示例28: Java_org_thoughtcrime_redphone_codec_SpeexCodec_closeSpeex

JNIEXPORT void JNICALL Java_org_thoughtcrime_redphone_codec_SpeexCodec_closeSpeex (JNIEnv *env, jobject obj ){  if( !initialized ) {    logv( env, "tried to shut down speex before initialization" );    return;  }  logv( env, "speex shutdown" );  speex_bits_destroy( &enc_bits );  speex_bits_destroy( &dec_bits );  logv( env, "bits destroyed" );  speex_encoder_destroy( enc );  speex_decoder_destroy( dec );  //  jitter_buffer_destroy( jitter );  logv( env, "codecs destroyed" );}
开发者ID:3141592653589793,项目名称:RedPhone,代码行数:19,



注:本文中的speex_bits_destroy函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ speex_bits_init函数代码示例
C++ speed函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。