码迷,mamicode.com
首页 > Windows程序 > 详细

api文档

时间:2016-01-07 20:16:23      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:

 

 

Method name

int GetLanguage(char* value)

Description

Get the language information for this engine

Input

name

type

expected value

description

 

 

 

 

Output

name

type

expected value

description

value

char*

at least 1 byte allocated memory

 

 

 

 

 

Return value

Signal : 0 to imply success, nonzero to imply failure

Deploy

 

Example

 

 

 

Method name

int GetSpeakers(char* value)

Description

Get the speaker information for this engine

Input

name

type

constraint

description

 

 

 

 

Output

name

type

constraint

description

value

char*

at least 1 byte allocated memory

 

 

 

 

 

Return value

Signal : 0 to imply success, nonzero to imply failure

Deploy

 

Example

 

 

 

Method name

int CreateEngine(char *fe_lib_path, char *be_lib_path, char *wav_path, int thread_num)

Description

Create TTS_Engine

Input

name

type

constraint

description

fe_lib_path

char*

 

front-end lib path

be_lib_path

char*

 

back-end lib path

wav

char*

 

audio files path

thread_num

int

range [1 64]

thread number

Output

name

type

constraint

description

 

 

 

 

Return value

Signal : 0 to imply success, nonzero to imply failure

Deploy

 

Example

CreateEngine(“felib”, “belib”, “wav”, 8)

 

 

Method name

int ReleaseEngine ()

Description

Release TTS_Engine

Input

name

type

constraint

description

 

 

 

 

Output

name

type

constraint

description

 

 

 

 

Return value

Signal : 0 to imply success, nonzero to imply failure

Deploy

 

Example

 

 

 

Method name

const EngineTask* CreateTask()

Description

Create an empty TTS_Task, caller will get a task handle.

Input

name

type

constraint

description

 

 

 

 

Output

name

type

constraint

description

 

 

 

 

Return value

A handle for further manipulating

Deploy

 

Example

 

 

 

Method name

int SetTaskOption(const EngineTask* pTask, const char* strName, const char* strValue)

Description

Use task handle to set options for TTS_Task

Input

name

type

constraint

description

pTask

const EngineTask*

 

task handle which is generated by CreateTask

strName

const char*

Must be “Content-Type” or “Accept”

key for setting option

strValue

const char*

See example

value for setting option

 

 

 

 

Output

name

type

constraint

description

 

 

 

 

Return value

Signal : 0 to imply success, nonzero to imply failure

Deploy

 

Example

SetTaskOption(ptask, "Content-Type", "text/plain;charset=utf-8");

SetTaskOption(ptask, "Accept", "audio/raw;coding=pcm");

SetTaskOption(ptask, "Accept", "audio/raw;coding=opus;bitrate=16000;samplerate=24000;speedrate=1.5");

 

 

Method name

int SetTaskText(const EngineTask* pTask, const char* strInput)

Description

Set the text for TTS_task

Input

name

type

constraint

description

pTask

const EngineTask*

 

task handle which is generated by CreateTask

strInput

const char*

 

Text for TTS_task

 

 

 

 

Output

name

type

constraint

description

 

 

 

 

Return value

Signal : 0 to imply success, nonzero to imply failure

Deploy

 

Example

 

 

Method name

int StartTask(const EngineTask* pTask)

Description

Start TTS_task

Input

name

type

constraint

description

pTask

const EngineTask*

 

task handle which is generated by CreateTask

 

 

 

 

Output

name

type

constraint

description

 

 

 

 

Return value

Signal : 0 to imply success, nonzero to imply failure

Deploy

 

Example

 

 

Method name

int GetTaskOptionOpen (const EngineTask* pTask)

Description

Get the number of key-value pairs of given TTS_Task.

Input

name

type

constraint

description

pTask

const EngineTask*

 

task handle which is generated by CreateTask

 

 

 

 

Output

name

type

constraint

description

 

 

 

 

Return value

the number of key-value pairs of given TTS_Task. Currently it is always 2

Deploy

 

Example

 

 

Method name

int GetTaskOptionPair(const EngineTask* pTask, const char** key, char** value)

Description

Start TTS_task

Input

name

type

constraint

description

pTask

const EngineTask*

 

task handle which is generated by CreateTask

 

 

 

 

Output

name

type

constraint

description

key

const char*

preallocated memory

key for setting option

value

const char*

preallocated memory

value for setting option

 

 

 

 

Return value

Signal : 0 to imply success, nonzero to imply failure

Deploy

 

Example

 

 

Method name

int GetTaskOptionClose(const EngineTask* pTask);

Description

Currently, it does nothing. I forgot the reason of its existence.

Input

name

type

constraint

description

pTask

const EngineTask*

 

task handle which is generated by CreateTask

 

 

 

 

Output

name

type

constraint

description

 

 

 

 

Return value

Signal : 0 to imply success, nonzero to imply failure

Deploy

 

Example

 

 

Method name

int IsTaskFinished (const EngineTask* pTask)

Description

Check if the given TTS_Task is finished

Input

name

type

constraint

description

pTask

const EngineTask*

 

task handle which is generated by CreateTask

 

 

 

 

Output

name

type

constraint

description

 

 

 

 

Return value

1 implies finished, else not finished

Deploy

 

Example

 

 

Method name

int FetchAudio(const EngineTask *ptask, char *outbuf)

Description

Fetch the audio generated by TTS_Engine

Input

name

type

constraint

description

pTask

const EngineTask*

 

task handle which is generated by CreateTask

 

 

 

 

Output

name

type

constraint

description

outbuf

char*

Preallocated memory

Buffer for receive audio results.

 

 

 

 

Return value

Signal : 0 to imply success, nonzero to imply failure

Deploy

 

Example

 

 

Method name

int DeleteTask (const EngineTask* pTask)

Description

After finished, call this api to delete TTS_Task

Input

name

type

constraint

description

pTask

const EngineTask*

 

task handle which is generated by CreateTask

 

 

 

 

Output

name

type

constraint

description

 

 

 

 

Return value

 

Deploy

 

Example

 

 

Method name

int GetEngineVersion ()

Description

Used for debugging. Give the version number to developer for debugging.

Input

name

type

constraint

description

 

 

 

 

Output

name

type

constraint

description

 

 

 

 

Return value

SVN version number

Deploy

 

Example

 

api文档

标签:

原文地址:http://www.cnblogs.com/doublemystery/p/5110945.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!