Go Down

Topic: RB-Dfr-552 Speech Synthesis module "code that works" (Read 67 times) previous topic - next topic

SHAtoday

First, look for the library to download.
Most places that sell this module have a link.
Second, go to Sketch, Include library, add zip Library.
Then, code the following with a speaker connected to the modules pins...I could not get the plug to work. 
When uploading, switch the Program / Run switch to program (it still uploads, but why not do what the directions say).  After compile and upload, it should work once you move the switch back to the Run position, "and hit the reset button on the module".  If you do not hit the reset button while powering up, it will not work.


Code: [Select]

#include <SpeechSynthesis.h>

void setup()
{
  Serial.begin(9600);
}

//SPEECH VALUES
byte ssr[500];//define a character string
byte d[]={0xB3,0xC9,0xB6,0xBC,0xBC,0xAB,0xC8,0xA4};


//create something that calls Voice() here; or perhaps in setup


void Voice()
{
 SpeechSynthesis.buf_init(d);//Clear the buffer
  delay(500);
  SpeechSynthesis.buf_init(ssr);//Clear the buffer
  SpeechSynthesis.English(ssr,4,"10");//volume in grade 5; 10 is top volume
  SpeechSynthesis.English(ssr,2,"1");//was 10 = 1 slows down the next thing said, 10 is fast
  SpeechSynthesis.English(ssr,6,"robot");//"6" means synthesis in English; "robot" is the content
  SpeechSynthesis.English(ssr,4,"10");//volume in grade 5
  SpeechSynthesis.English(ssr,2,"3");//was 10 = 1 slows down the next thing said, 10 is fast     1 = very slow, 2 = good
  SpeechSynthesis.English(ssr,6,"awake");//"6" means synthesis in English; "awake" is the content
  SpeechSynthesis.Espeaking(0,19,4,ssr);//Executive commands above,
}

Go Up