Main Page   Hardware Class Hierarchy   Hardware API     Mapping Class Hierarchy  Mapping API 

oTTSemic Class Reference

an EMIC #36000 TTY text to speech unit More...

#include <ottsemic.h>


Public Member Functions

 oTTSemic (IOLINE rx, IOLINE tx)
 Constructor for emic Text to Speech Unit.

void send_command (const char *const icommand, const char *const iparm)
 transmits an ASCII emic command.

bool say (const char *const icommand)
 wrapper for say command.

void receive_ack (void)
 will wait for a 'OK' or "ERROR" string from emic module.

bool error (void)
 Return whether last command was an error (true).

void reset (void)
 Performs a soft reset.


Detailed Description

an EMIC #36000 TTY text to speech unit

The oTTSemic object allows the conversion of text to speech using the Emic #36000 module.

Operation
Note that since the binary transmits a 0x0 character, the ASCII mode was used to be on the safe side. Pretty straight forward really.
Remarks
Module installs easily, the only catch is you have to send a hard or soft reset before using the board. Also, for some reason, after a soft reset, I get an "OK" acknowledge followed by an "ERROR" acknowledge. Haven't tracked down why this is. Skirted the issue with the get_any_ack method which eats up any response after a reset command.
Sample Code
#include <hardware/oled.h>
#include <oconsole.h>
#include "ottsemic.h"
oConsole console;
oTTSemic  emic(8,9);
char RXbuff[251];
char TXbuff[251];
oGreenLED green;
oRedLED red;
// -----------------------------------------------------------------
// MAIN
// -----------------------------------------------------------------
int main()
{
char c;
  red.off();
  green.on();
  console.buffer(&RXbuff[0],250,&TXbuff[0],250);
  console.syncronize();
  emic.reset();
bool  done = false;
  while (!done)
  {
    emic.say("Hello.  My name is Daisy.  What is you're name?");
    console.echo("x to exit; anything else to repeat\n");
    c = console.get();
    if (c == 'x') done = true;
  } 
  emic.say("goodbye");
  console.echo("done");
  green.off();
  red.on();
  for (int i=0; i<190000; i++);
  exit(0);
}


Constructor & Destructor Documentation

oTTSemic IOLINE  rx,
IOLINE  tx
 

Constructor for emic Text to Speech Unit.

Parameters:
rx - TPU channel for recever (SOUT of Emic #36000 SIP)
tx - TPU channel for transmitter (SIN of Emic #36000 SIP)


Member Function Documentation

bool say const char *const  icommand  ) 
 

wrapper for say command.

Note:
Do NOT put an receive_ack with this command. The wrapper performs this function.

void send_command const char *const  icommand,
const char *const  iparm
 

transmits an ASCII emic command.

Parameters:
icommand : emic command to transmit
iparm : parameter for command or NULL string ("") for none. Allows the sending of any command and parameter. For example, send_command(VOLUME,"7"); The following are the valid commands:
  • SAY : any text
  • RESET : no parameter.
  • VOLUME : 0-7 (default 4)
  • SPEED : 0-4 (default 2)
  • PITCH : 0-6 (default 2)
  • AUDIO : no parameter


The documentation for this class was generated from the following file:
Generated on Mon Oct 8 19:32:45 2007 for OOMRM Hardware API by doxygen1.3