Reference

Last revision 2025/12/11

The article delves into the Speech Synthesis Library V2, offering insights into its UART communication protocol, API commands including initialization, speech synthesis, and execution functions, along with improvements in number synthesis and its compatibility with a wide range of controller boards.

Communication Protocol Description

It is using UART communication to make it widely compatible with most controller boards.

API Description

Here is the NEW Speech Synthesis library V2, it fixed some bugs about the number synthesis.

A complete command is composed by three sections: Initialization Function, Speech Synthesis Function and Execute Function.

Initialization Function

    SpeechSynthesis.buf_init(ssr);

It will clear all buffer on your board, and initialize chip setting.

Speech Synthesis Function

'''SpeechSynthesis.English(char sr[ ],byte cmd,char a[ ]);
Description:
1、char sr[ ]-->the content which will be read by the module
2、byte cmd -->the command which will be sent to the module
3、char a[ ] -->the content

Speech Synthesis Shield

For Example:

    SpeechSynthesis.English(ssr,4,"5");        //volume in grade 5
    SpeechSynthesis.English(ssr,6,"cooki");    //"6" means synthesis in English; "cooki"is the content

Execute Function

SpeechSynthesisClass::Espeaking(byte cmda ,byte cmdb,byte cmdc,char c[])
Description:
1、char cmda-->Working mode
2、byte cmdb-->Select speaker
3、char cmdc-->Speaking Command format
4、char c[ ] -->the content

For Example:
SpeechSynthesis.Espeaking(0,19,4,ssr); //"0" means command (speech synthesis command);"19" means the choice who to speak;"4" means the format of reading;"ssr" store the content.

char cmda

/*parameter value*/ meaning
/*0*/ Speech Synthesis Command
/*1*/ Stop Speech Synthesis Command
/*2*/ Pause Speech Synthesis Command
/*3*/ Resume Speech Synthesis Command
/*4*/ Check Status
/*5*/ Enter power-save mode

byte cmdb

/*parameter value*/ meaning
/*0*/Men Voice:“I am XuJiu”
/*1*/Men Voice:“I am XuDuo”
/*2*/Women Voice:“I am XiaoPin”
/*3*/Donald Duck Voice:“I am a Duck”
/*4*/Girls Voice:“I am a girl”
/*5*/Yong Woman Voice:“I am XuDuo”
/*6*/Men Voice:“I am John”(English Only)
/*7*/Women Voice:“I am Terry”(English Only)
/*8*/Women Voice:“I am Catherine”(English Only)
/*9*/~/*16*/ Chinese Dialect(If you are interested in this, you could try it one by one, it is very funny!)
/*17*/Boys Voice:“I am John”
/*18*/Girls Voice:“I am Lina”
/*19*/Women Voice:“I am Robot”

char cmdc

/*parameter value*/ meaning
/*4*/123km Synthesised as:“one hundred and twenty three kilometres”
/*6*/Words“you” Synthesised as:“y-o-u”
/*7*/Words“you” Synthesised as:“you”

Was this article helpful?

TOP