In my last Blog I looked at SAM. Now it is time to look at jscrane/TTS.

TTS is a popular Text-to-Speech Library for Arduino which is supporting many different Microcontroller Architectures.

I was extending the project, so that I could receive the data as stream: My extended project can be found on Github.

Like for SAM, the Arduino sketch for the Webserver is also quite small because I am using my arduino-audio-tools . TTS is providing 1 channel with 8 bit data with a sampling rate of 12000:

#include "TTS.h"
#include "AudioServer.h"

using namespace audio_tools;  

AudioWAVServer server("ssid","password");

// Callback which provides the audio data 
void outputData(Stream &out){
  Serial.print("providing data...");
  TTS tts(out);
  tts.sayText("Hallo, my name is Alice");

void setup(){
  // start data sink
  TTSInfo info = TTS::getInfo();
  server.begin(outputData, info.sample_rate, info.channels, info.bits_per_sample);

// Arduino loop  
void loop() {
  // Handle new connections

Well the rendering of the result was rather quick (2 sec) but it does not sound great as well:


Leave a Reply

Avatar placeholder

Your email address will not be published.