Source file: /~heha/basteln/Haus/Telefon/Sprachausgabe.zip/VS6/ESP8266SAM.cpp

/*
  ESP8266SAM
  Port of SAM to the ESP8266
  Copyright (C) 2017  Earle F. Philhower, III
*/
#include "ESP8266SAM.h"
extern "C" {
#include "reciter.h"
#include "sam.h"
}
#include "SamData.h"
#include <string.h>	// strlen()
#include <ctype.h>	// toupper()
#include <stdio.h>
SamData samdata;

bool ESP8266SAM::Say(const char*str)
{
  if (!str || strlen(str)>254) return false; // Only can speak up to 1 page worth of data...
  
  // Input massaging
  char input[256];
  int i;
  for (i=0; str[i]; i++) input[i] = toupper(str[i]);

#ifndef NORECITER
  // To phonemes
  if (phonetic) {
#endif
   input[i]=(char)0x9B;
   input[++i]=0;
#ifndef NORECITER
  } else {
   input[i]='[';
   input[++i]=0;
   if (!TextToPhonemes(input)) return false; // ERROR
   printf("Phonemics: %s\n",input);
  }
#endif
  // Say it!
  SetInput(input);
  SAMMain();
  return true;
}
Detected encoding: ASCII (7 bit)2