Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
TextToSpeech Class Reference

#include <text_to_speech.h>

Public Member Functions

bool audioConverter (const std::string base_path, const char *src_text)
 
string getAudioFile (map< string, string > current_map)
 
int play_wav (const string &file_path)
 
int set_pcm_play (FILE *fp, wave_pcm_hdr *wav_header)
 
 TextToSpeech (const string &basePath, const char *src_text, const string &audioFile)
 
 TextToSpeech ()
 
 TextToSpeech (const char *src_text)
 
 ~TextToSpeech ()
 

Static Public Member Functions

static map< string, string > createMap ()
 

Private Attributes

string audioFile
 
string basePath
 
const char * src_text
 

Static Private Attributes

static map< string, string > text_audio_map = TextToSpeech::createMap()
 

Detailed Description

Definition at line 38 of file text_to_speech.h.

Constructor & Destructor Documentation

TextToSpeech::TextToSpeech ( const string &  basePath,
const char *  src_text,
const string &  audioFile 
)

Definition at line 24 of file text_to_speech.cpp.

TextToSpeech::TextToSpeech ( )

Definition at line 11 of file text_to_speech.cpp.

TextToSpeech::TextToSpeech ( const char *  src_text)

Definition at line 19 of file text_to_speech.cpp.

TextToSpeech::~TextToSpeech ( )

Definition at line 35 of file text_to_speech.cpp.

Member Function Documentation

bool TextToSpeech::audioConverter ( const std::string  base_path,
const char *  src_text 
)

tts功能实现函数

Parameters
src_text要转换成播放语音的文字
Returns
播放生成语音
  • false表示转换失败

Definition at line 61 of file text_to_speech.cpp.

map< string, string > TextToSpeech::createMap ( )
static

Definition at line 39 of file text_to_speech.cpp.

string TextToSpeech::getAudioFile ( map< string, string >  current_map)

该函数生成音频文件存储路径

Parameters
current_map当前的文本与语音文件的映射
Returns
指定的路径

Definition at line 50 of file text_to_speech.cpp.

int TextToSpeech::play_wav ( const string &  file_path)

Definition at line 322 of file text_to_speech.cpp.

int TextToSpeech::set_pcm_play ( FILE *  fp,
wave_pcm_hdr wav_header 
)

Definition at line 192 of file text_to_speech.cpp.

Member Data Documentation

string TextToSpeech::audioFile
private

Definition at line 44 of file text_to_speech.h.

string TextToSpeech::basePath
private

Definition at line 42 of file text_to_speech.h.

const char* TextToSpeech::src_text
private

Definition at line 43 of file text_to_speech.h.

map< string, string > TextToSpeech::text_audio_map = TextToSpeech::createMap()
staticprivate

Definition at line 45 of file text_to_speech.h.


The documentation for this class was generated from the following files:


xbot_talker
Author(s): wangxiaoyun
autogenerated on Sat Oct 10 2020 03:27:54