• 去除MFC特性之一


    先对文件读取路径进行去除,然后对程序中出现的其他地方进行慢慢去除。

    #include "WavIo.h"
    #include "mfcc.h"
    #include "GMM.h"
    
    void main()
    {
        //string featpath = "G:\data";
        string wawfile = "MF.wav";                //转换正确——1
        const char* rawfile=wawfile.data();
    
        RealVec signal;
        wavfile::Read(rawfile, signal);
    
        RealMat features;
        MFCC::Run(signal, 12, features);
    
        GMM model;
        model.Train(features, 32);
        model.WriteTxt("ubm.txt");
    }
    //

    参考于:

    string 是c++标准库里面其中一个,封装了对字符串的操作 
    把string转换为char* 有3中方法: 
    1.data 
    如: 
    string str="abc"; 
    char*p=str.data(); 
    2.c_str 
    如:string str="gdfd"; 
         const char*p=str.c_str(); 
    3.copy
    比如 
    string str="hello"; 
    char p[40]; 
    str.copy(p,5,0); //这里5,代表复制几个字符,0代表复制的位置
    *(p+5)=''; //要手动加上结束符
    cout <<p;
  • 相关阅读:
    robots协议
    Java Script学习 4(转)
    Java Script学习 3(转)
    HTML 8 总结(转)
    HTML 7 (转)
    HTML 6 (转)
    HTML 5 (转)
    python类方法/实例方法/静态方法
    chromedriver下载地址
    字符编码表
  • 原文地址:https://www.cnblogs.com/taozijy/p/3723063.html
Copyright © 2020-2023  润新知