Would you like to add voice to your projects? Connect up this Speech Synthesis module, add few couples of lines of code, then here goes, your project starts speaking. Both Chinese and English are "so easy" for this speech synthesis module. It also can broadcast the current time and environment data. Combining with a speech recognition module, you can easily have conversations with your projects! The module uses I2C and UART two communication modes, gravity interface, and is compatible with most main-controllers on the market. Besides, the module already comes with a speaker, so you don't need to buy one.
Num | Label | Description |
---|---|---|
1 | D/T | I2C data line/TX |
2 | C/T | I2C clock line/RX |
3 | GND | - |
4 | VCC | + |
5 | AOP | Audio Output Positive |
6 | AON | Audio Output Negative |
This speech synthesis module supports multiple text control identifiers that allow users to set voice speaker, volume, speed, and intonation, etc. Identifiers are only used as control flags to realize function setting, and will not be synthesized into sound output. For instance, "[S1]I talk slowly. [S8] I talk fast", after setting the identifiers, the former sentence will be read very slowly while the latter one will be spoken very fast, but "S1" and "S8" will not be read out.
Note: these identifieres are global control identifiers, which means that they only need to be set for once. When the chip is not reset, or powered off, or using [D] to restore the default setting, all texts sent to the chip will be under their control.
The module repeatedly reads out the synthesised speech (Dial the switch to I2C).
#include "DFRobot_SpeechSynthesis.h"
DFRobot_SpeechSynthesis_I2C ss;
void setup() {
//Init speech synthesis sensor
ss.begin();
//Set voice volume to 5
//ss.setVolume(5);
//Set playback speed to 5
//ss.setSpeed(5);
//Set speaker to female
//ss.setSoundType(ss.FEMALE1);
//Set tone to 5
//ss.setTone(5);
//For English, speak word
//ss.setEnglishPron(ss.WORD);
}
void loop() {
ss.speak(F("She sells seashells by the seashore"));
ss.speak(F("Hello, I'm Speech Synthesis module"));
ss.speak(F("a b c d e f g"));
/*Use text control identifier*/
//Voice volume identifier
//ss.speak(F("[v3]Hello [v8]world"));
//Word Pronounce mode identifier
//ss.speak(F("[h1]Hello [h2]world"));
}
The module repeatedly reads out the synthesised speech (Dial the switch to UART). It is recommended to use hardware serial port for stable communication.
#include "DFRobot_SpeechSynthesis.h"
#include <SoftwareSerial.h>
SoftwareSerial ssSerial1(2, 3); //RX, TX
DFRobot_SpeechSynthesis_UART ss;
void setup() {
ssSerial1.begin(115200);
//Init speech synthesis sensor
ss.begin(ssSerial1);
//Set voice volume to 5
//ss.setVolume(5);
//Set playback speed to 5
//ss.setSpeed(5);
//Set speaker to female
//ss.setSoundType(ss.FEMALE1);
//Set tone to 5
//ss.setTone(5);
//For English, speak word
//ss.setEnglishPron(ss.WORD);
}
void loop() {
ss.speak(F("She sells seashells by the seashore"));
ss.speak(F("Hello, I'm Speech Synthesis module"));
ss.speak(F("a b c d e f g"));
/*Use text control identifier*/
//Voice volume identifier
//ss.speak(F("[v3]Hello [v8]world"));
//Word Pronounce mode identifier
//ss.speak(F("[h1]Hello [h2]world"));
}