Introduction: Speech Synthesis Shield for Arduino

When using the Arduino to do robot or interactive projects, is it nice to have them speak? Now there is a shield based on iFLYTEK XFS505 speech synthesis chip to help you solve the problem. Arduino can communicate with the  speech synthesis module through UART. With an  external speaker, this module can speak both English  and Chinese.

Step 1: Feature

Baud rate:4800,9600,57600,115200
Working  voltage:+5 V
11 different speak speed
Support English
Support Chinese
Support Male, Female and Chidl
Size: 56 x 53 mm
Weight: 26g

Step 2: Part List

1   x  Arduino UNO
1   x  Speech synthesis shield
1   x  Mini Speaker

Step 3: Run Test

1. Download (SpeechSynthesis)test library,and move to “arduino-1.0/libraries”
2. Open Arduino IDE,open the sample code:

3. Toggle the switch to Prog port as shown in the picture, and download the code:

4. Toggle the switch to the Run, set B1=0, B2=1( baud rate 9600), connect the Mini speaker, you will hear the sound:

Step 4: Explain the Function

Initialization Function:

Initialization function is used to initial the array function which is to store speech content.

Initialization function is a function used to initialize an array to store speech content.

?
1
Void SpeechSynthesis.m_init(byte ay[]);
Parameter Description:

Byte ay[] store speech synthesis content
Note: ay[0] and ay[1] store the speech synthesis content length +2( the ay has already stored  the number of data )

Examples:

?
1
2
3
byte sr[200];

SpeechSynthesis.m_init(sr);
Explanation: sr stores the speech synthesis content.

Speech synthesis function

Speech synthesis function is used to synthesize the required speech synthesis content and point on how to read the content of the speech function.

?
1
Void SpeechSynthesis.mvmv(byte ax[],byte bm[],int n,char c[],byte cmd,byte cmd);
Parameter Description:

Byte ay[] store speech synthesis content
Byte bm[] phonetic content
Int n phonetic content length
Byte cmd speech synthesis function command
Char c[] English content or command parameter values
Example:

?
1
2
3
byte d[]={0xB3,0xC9,0xB6,0xBC,0xBC,0xAB,0xC8,0xA4};

SpeechSynthesis.mvmv(sr,d,sizeof(d),6,0);
Explanation :

Sr[] stores speech synthesis content; d is the content of Chinese character synthesis content; sizeof(d) is the Chinese

Content length; 6 is the command( Chinese synthesis); 0 parameter has no meaning but occupy the position.

?
1
SpeechSynthesis.mvmv(sr,0,0,7,”hello d f robot”);
Explanation :

Sr[] store speech synthesis content; 0 need not to synthesize Chinese character content; 0 is the Chinese

Content length; 7 is the command( English synthesis); “hello d f robot” need to synthesize English content

?
1
SpeechSynthesis.mvmv(sr,0,0,1,”26″);
Explanation :

Sr[] store speech synthesis content; 0 need not to synthesize Chinese character content; 0 is the Chinese

Content length; 1 is the command( mute: the maximum mute length is 268 seconds, in milliseconds);

26 is parameter values ​​mute time 26 ms;

Notice: Cmda the value and significance ( the command of voice synthesis function): / * parameter value * /

Parameter means:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/ * 0 * / 8016700 read as: eight o (sound "Europe") one, six seven oo (sound "Europe") 8016700 read as: eight zero one, six seven zero zero

/ * 1 * / / Mute:  the maximum mute length is 268 seconds, in milliseconds.

/ * 2 * / Speed​​: Speed ​​offers 11 of the regulation, a minimum of 0 and a maximum of 10 chips default / / Speed ​​is 5, the faster the higher the value.

/ * 3 * / volume control: Provides 11 tone adjustment, the default tone chip size is 5, the minimum is 0 and the maximum is 10. The higher the value the louder.

/ * 4 * / volume control: Provide 11 to adjust the volume, minimum 0 Static / / sound chip default volume level is 5. # And * where it was processed into a short pause

/ * 5 * / volume control: "revert to the default rate, volume, tone synthesis.

/ * 6 * / Chinese synthesis

/ 7 * / English synthesis *
Execute function

Executing function is used to define the work modem, pronunciation person and the pronunciation function format.

?
1
<strong>Void SpeechSynthesis.command(byte cmda ,byte cmdb,byte cmdc,byte c[]);</strong>
Parameter Description:

byte cmda  execute function command 1  (mode)

byte cmdb execute function command 2(select pronounce people)

byte cmdc execute function command3(pronounced format)

byte c []  has synthesized speech content

Example:

SpeechSynthesis.command(0,0,7,sr);

Description: 0 Command (synthetic command); 0 command (select pronounce people); 7 Command (pronounced format); sr need to read the contents
Notice:

Cmda value and significance  ( operating mode ) :

/ * Parameter value * / parameter significance

/ * 0 * / synthetic command

/ * 1 * / stop commands synthesis

/ * 2 * / Pause command synthesis

/ * 3 * / restore command Synthesis

/ * 4 * / status query commands

/ * 5 * / into power saving mode command

Cmdb value and significance ( select pronunciation person ) :

/ * Parameter value * / parameter significance

/ * 0 * / I am a long time. Male voice synthesis : “I am a long time .”

/ * 1 * / I am a lot. Male voice synthesis : “I am a lot ”

/ * 2 * / I Xiaoping . Girls synthesis : “I am Xiaoping ”

/ * 3 * / I’m Donald Duck . Donald analog sound synthesis : “I was Donald Duck .”

/ * 4 * / I promised Andy . Girls sound synthesis : “I promised Andy ”

/ * 5 * / I know the dream . Girl Synthetic Synthetic : “I am dawn dream”

/ * 6 * English male voice synthesis /: “I am John” ( read only English )

/ * 7 * / English female voice synthesis : “I am Terry” ( read only English )

/ * 8 * / English female voice synthesis : “I am Catherine” ( read only English )

/ * 9 * / I is Xiaoqian . Northeast synthetic female voice : ” I was Xiaoqian ” (read Chinese )

/ * 10 * / I Xiaorong . Sichuan synthetic female voice : “I am Xiaorong ” (read Chinese )

/ * 11 * / I was Akemi . Cantonese synthetic female voice : ” I was Akemi ”

/ * 12 * / I am Xiaolin . Girls synthesis Taiwan : “I am Xiaolin ”

/ * 13 * / I am a little strong . Hunan male voice synthesis : ” I am little strong” (read Chinese )

/ * 14 * / I am a small -kun . Henan male voice synthesis : ” I am a small -kun ” (read Chinese )

/ * 15 * / I was the big dragon. Cantonese male voice synthesis : ” I was big dragon”

/ * 16 * / I Xiaoyan . Girls synthesis : “I am Xiaoyan ”

/ * 17 * / I am a small peak . Male voice synthesis : ” I am a small peak”

/ * 18 * / I Nannan . Girls sound synthesis : “I am Nannan ”

/ * 19 * / I am Xiao Jing . Girls synthesis : “I am Xiao Jing ”

Cmdc value and significance ( pronounced format ) :

/ * Parameter value * / parameter significance

/ * 0 * / IFLYTEK synthesized as follows: “Section – big – News – fly ”

/ * 1 * / IFLYTEK synthesized as follows: ” IFLYTEK ”

/ * 2 * / 123km synthesis as: ” one hundred twenty-three kilometers .”

/ * 3 * / 123km synthesis as: ” one hundred twenty-three kilometers .”

/ * 4 * / 123km synthesized as : “one hundred and twenty three kilometres”

/ * 5 * / Your English is “you” synthesized as follows: “Your English is you”

/ * 6 * / Your English is “you” synthesized as follows: “Your English is you”

/ * 7 * / Your English is “you” synthesized as follows: “Your English is you”

/ * 8 * / HKUST fei1 chip does not recognize the phonetic format. Synthesized as follows: ” HKUST F E I”

/ * 9 * / HKUST fei1 chip identification phonetic format. Synthesized as follows: ” IFLYTEK ”

/ * 10 * / Jiang Qin River Bridge synthesized as : “jiang1 qin2 he2 qiao2″

/ * 11 * / Jiang Qin River Bridge synthesized as : “jiang1 zhen1 he2 qiao2″

/ * 12 * / 234 343 545 chip automatic judgment. Read: 234,343,545

/ * 13 * / [n1] 234343545 mandatory according to the number of chips synthesized string of numbers . Read: 234,343,545

/ * 14 * / 234 343 545 Circuit Synthesis forced manner numeric string value . Read: 234,343,545

/ * 15 * Richard Lai chip synthesized according to the default / . Read as : chá lì

/ * 16 * / Charles Li chip forced the text of the first synthesized according to the pronunciation of Chinese characters surnames . Read as : zhā lì

/ * 17 * / tone ringtones [x0] sound101 corresponding sound is [x1] sound101

/ * 18 * / are functioning . Read: pre-defined tone ringtones / / sound101 of ( BEEP sound101 ringtone )

/ * 19 * / 010-58301005-8016 / / Chip accordance with the ” unitary ” read the text of the synthesis of the number “1 .” Read: zero / / unitary unitary December 2005 eight hundred thirty five unitary turn eighty six

/ * 20 * / 010-58301005-8016

/ Chip accordance with the ” a ” to read the text in the synthesis of the number “1 .” Read: zero 1,058,301,005 turn eight thousand and sixteen

/ * 21 * / # Anhui USTC * Iflytek chip read as ” Anhui pound KEXUN fly big asterisk”

/ * 22 * / * Iflytek big Anhui Branch #

Comments

author
bos4t. (author)2016-06-11

How do you make unit speak numbers,variables?

what does code look like?

author
survtech (author)2014-03-27

How do you make this unit speak a variable?

author
rldkfl (author)2014-03-25

http://www.dfrobot.com/index.php?route=product/product&filter_name=speech&product_id=1086

author
Johnny J (author)2014-03-25

http://pages.ebay.com/link/?nav=item.view&id=321341120256

author
gada888 (author)2014-03-25

Where to get one?