⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dec_input_2.cc

📁 这是处理语音信号的程序
💻 CC
字号:
// file: dec_input_0.cc// // isip include files//#include "decoder.h"#include "decoder_constants.h"// method: read_features_cc//// arguments://  none//  // return: a logical_1 indicating status//// this method reads in the input feature vector from data buffer// Note: Communicator API//logical_1 Decoder::read_features_cc() {  // check file  //  if (buf_d == NULL) {    error_handler_cc((char_1*)"read_features_cc",		     (char_1*)"NULL input file pointer");  }    // initialize features if not done so  //  if (features_d == (float_4*)NULL) {    features_d = new float_4[num_feat_d];  }  // mfc file is stored by double, but we will read it by float  //  float_8 *tmp_features;  tmp_features = (float_8*) &buf_d[0];  tmp_features += current_d;    // dummy flag  //  logical_1 flag = ISIP_FALSE;  int_4 i = 0;    // if this is ascii format data  //  if (input_format_d == DEC_ASCII_FORMAT) {    // read values one at a time    //    while (size_d > current_d) {      // copy the data to the float buffer      //      features_d[i] = tmp_features[i++];            // error message if input feature value is NaN      //      if (isnan(features_d[i])) {	error_handler_cc((char_1*)"dec_input_0.cc", (char_1*)"Input feature value is either NaN");      }            // if data is read      //      if (i == num_feat_d) {	flag = ISIP_TRUE;	break;      }    }  }    // otherwise this is binary format data  //  else {        // read vector at once    //    if ((size_d - current_d) >= num_feat_d) {      for (int_4 j = 0; j < num_feat_d; j++) {	features_d[j] = (float_4) tmp_features[j];	current_d++;		// error message if input feature value is NaN	//	if (isnan(features_d[j])) {	  error_handler_cc((char_1*)"dec_input_0.cc", (char_1*)"Input feature value is NaN");	}	      }      flag = ISIP_TRUE;    }    else {      flag = ISIP_FALSE;    }  }  // exit gracefully  //  return flag;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -