Reference
Last revision 2025/12/03
Library
Download and install the DFRobot Speech Synthesis Library. (About how to install the library?)
API Description
/**
* @brief Speech Synthesis function
* @param word Content to be synthesized, it can be Chinese, English, number, etc.
*/
void speak(String word);
/**
* @brief Set voice volume
* @param voc, Volume value(0-9)
*/
void setVolume(uint8_t voc);
/**
* @brief Set playback speed
* @param speed, speed value (0-9)
*/
void setSpeed(uint8_t speed);
/**
* @brief Set tone
* @param tone, tone value(0-9)
*/
void setTone(uint8_t tone);
/**
* @brief Set English Pronounce mode
* @param pron(eAlphabet: letter, eWord: word)
*/
void setEnglishPron(eENpron_t pron);
Text Control Identifiers
The addresses of the speech synthesis module and micro: bit motor driver board are the same, so they cannot be used together.
V2.0 Function Updates:
- More natural pronunciation
- Fewer pronunciation errors for polyphone characters
- The option to select a pronouncer has been cancelled
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.
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.

Was this article helpful?
