SP03 Text to Speech Synthesizer
SP03.h@0:2326b6172834, 2014-05-07 (annotated)
- Committer:
- yangcq88517
- Date:
- Wed May 07 13:52:08 2014 +0000
- Revision:
- 0:2326b6172834
- Child:
- 1:58ab657cd515
SP03 I2C
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yangcq88517 | 0:2326b6172834 | 1 | #ifndef Smartlab_Drive_SP03 |
yangcq88517 | 0:2326b6172834 | 2 | #define Smartlab_Drive_SP03 |
yangcq88517 | 0:2326b6172834 | 3 | |
yangcq88517 | 0:2326b6172834 | 4 | #include "SP03SpeechSetting.h" |
yangcq88517 | 0:2326b6172834 | 5 | #include "mbed.h" |
yangcq88517 | 0:2326b6172834 | 6 | |
yangcq88517 | 0:2326b6172834 | 7 | class SP03 |
yangcq88517 | 0:2326b6172834 | 8 | { |
yangcq88517 | 0:2326b6172834 | 9 | private: |
yangcq88517 | 0:2326b6172834 | 10 | static const uint8_t DEFAULT_ADDRESS = 0xC4; |
yangcq88517 | 0:2326b6172834 | 11 | static const int CLOCK_RATE = 100000; |
yangcq88517 | 0:2326b6172834 | 12 | static const uint8_t REGISTER_FOR_COMMAND = 0x00; |
yangcq88517 | 0:2326b6172834 | 13 | static const uint8_t REGISTER_FOR_SOFTWARE_REVISION_NUMBER = 0x01; |
yangcq88517 | 0:2326b6172834 | 14 | static const uint8_t SPEAK_OUT_THE_BUFFER = 0x40; |
yangcq88517 | 0:2326b6172834 | 15 | static const uint8_t DEFAULT_SPEECH_PITCH = 0x03; |
yangcq88517 | 0:2326b6172834 | 16 | |
yangcq88517 | 0:2326b6172834 | 17 | I2C i2c_bus; |
yangcq88517 | 0:2326b6172834 | 18 | |
yangcq88517 | 0:2326b6172834 | 19 | void _speak(const char message[],SmartLab_SP03::Speech_Speed speed, SmartLab_SP03::Speech_Volume volume,uint8_t pitch); |
yangcq88517 | 0:2326b6172834 | 20 | public : |
yangcq88517 | 0:2326b6172834 | 21 | |
yangcq88517 | 0:2326b6172834 | 22 | SP03(PinName sda, PinName scl); |
yangcq88517 | 0:2326b6172834 | 23 | |
yangcq88517 | 0:2326b6172834 | 24 | void Speak(const char message[]); |
yangcq88517 | 0:2326b6172834 | 25 | |
yangcq88517 | 0:2326b6172834 | 26 | void Speak(const char message[],SmartLab_SP03::Speech_Speed speed, SmartLab_SP03::Speech_Volume volume); |
yangcq88517 | 0:2326b6172834 | 27 | |
yangcq88517 | 0:2326b6172834 | 28 | void Speak(const char message[],SmartLab_SP03::Speech_Speed speed, SmartLab_SP03::Speech_Volume volume,uint8_t pitch); |
yangcq88517 | 0:2326b6172834 | 29 | |
yangcq88517 | 0:2326b6172834 | 30 | bool IsSpeaking(); |
yangcq88517 | 0:2326b6172834 | 31 | }; |
yangcq88517 | 0:2326b6172834 | 32 | |
yangcq88517 | 0:2326b6172834 | 33 | #endif |