Path: blob/master/examples/cpptflite/src/TTSFrontend.h
1559 views
#ifndef TTSFRONTEND_H1#define TTSFRONTEND_H23#include <iostream>4#include <string>5#include <vector>6#include <regex>7#include <stdio.h>89class TTSFrontend10{11public:1213/**14* Converting text to phoneIDs.15* A tmporary method using command to process text in this demo,16* which should to be replaced by a pronunciation processing module.17*@param strCmd Command to call the method of processor.text_to_sequence()18*/19TTSFrontend(const std::string &mapperJson,20const std::string &strCmd):21_mapperJson(mapperJson),22_strCmd(strCmd)23{24std::cout << "TTSFrontend Init" << std::endl;25std::cout << _mapperJson << std::endl;26std::cout << _strCmd << std::endl;27};2829void text2ids(const std::string &text);3031std::vector<int32_t> getPhoneIds() const {return _phonesIds;}32private:3334const std::string _mapperJson;35const std::string _strCmd;3637std::vector<int32_t> _phonesIds;3839std::string getCmdResult(const std::string &text);40std::vector<int32_t> strSplit(const std::string &idStr);41};4243#endif // TTSFRONTEND_H4445