SP03 Text to Speech Synthesizer

Embed: (wiki syntax)

« Back to documentation index

SP03 Class Reference

SP03 Class Reference

Example: More...

#include <SP03.h>

Public Member Functions

 SP03 (PinName sda, PinName scl)
 Construct.
void speak (const char *message)
 Set the speed of the speech.
void setSpeed (char speed)
 Set the speed of the speech.
void setVolume (char volume)
 Set the volume of the speech.
bool isSpeaking ()
 Check if the SP03 is currently talking.

Detailed Description

Example:

 #include "mbed.h"
 #include "SP03.h"

 DigitalOut myled(LED1);
 SP03 sp03(p28, p27);

 int main()
 {
    sp03.setSpeed(SP03::SPEED_NORMAL);

    sp03.setVolume(SP03::VOLUME_MAX);

    while(1) {
        if (!sp03.isSpeaking()) {
            myled = 1;
            sp03.speak("Hello CQ 1 2 2 3  4 6 76 7 9 9 08 8");
        } else
            myled = 0;
    }
 }

Definition at line 30 of file SP03.h.


Constructor & Destructor Documentation

SP03 ( PinName  sda,
PinName  scl 
)

Construct.

Parameters:
sdaI2C sda signal
sclI2C scl signal

Definition at line 3 of file SP03.cpp.


Member Function Documentation

bool isSpeaking (  )

Check if the SP03 is currently talking.

Returns:
ture device is talking and no command can be send, false command can be issued

Definition at line 45 of file SP03.cpp.

void setSpeed ( char  speed )

Set the speed of the speech.

Parameters:
speed[SPEED_NORMAL = 0x05, SPEED_FAST = 0x02, SPEED_SLOW = 0x06]

Definition at line 35 of file SP03.cpp.

void setVolume ( char  volume )

Set the volume of the speech.

Parameters:
volume[VOLUME_MAX = 0x00, VOLUME_MEDIUM = 0x03, VOLUME_MIN = 0x06]

Definition at line 40 of file SP03.cpp.

void speak ( const char *  message )

Set the speed of the speech.

Parameters:
messageNULL terminated char array

Definition at line 10 of file SP03.cpp.