It was quite a challenge to convert eSpeak NG to an Arduino Library.

The eSpeak NG is a compact open source software text-to-speech synthesizer for Linux, Windows, Android and other operating systems. It supports more than 100 languages and accents. It is based on the eSpeak engine created by Jonathan Duddington.

Language Specific Configuration Files

Using a foreign language is quite easy: You just need to load the language dependent files and set the corresponding voice. Here is the list of all language configuration files that are available.

The Arduino Sketch

To preserve some valuable memory we do not load the (default) English language, but I set up the German (de) language instead:

#include "AudioTools.h" //
#include "FileSystems.h" //
#include "espeak.h" //

I2SStream i2s; // or replace with AudioKitStream for AudioKit
const bool load_english = false;
ESpeakPROGMEM espeak(i2s, load_english);

void setup() {

  // add foreign language configuration file
  espeak.add("/mem/data/de_dict", espeak_ng_data_de_dict,espeak_ng_data_de_dict_len);
  espeak.add("/mem/data/lang/de", espeak_ng_data_lang_gmw_de, espeak_ng_data_lang_gmw_de_len);

  // setup espeak
  // Set voice

  // setup output
  audio_info espeak_info = espeak.audioInfo();
  auto cfg = i2s.defaultConfig();
  cfg.channels = espeak_info.channels; // 1
  cfg.sample_rate = espeak_info.sample_rate; // 22050
  cfg.bits_per_sample = espeak_info.bits_per_sample; // 16

void loop() {
  espeak.say("Hallo Welt!");


This library requires the installation of the following libraries:

Supported Platforms

For the time being I have only tested this sketch on an ESP32. Please note that the sketch needs about 1’638’633 bytes of PROGMEM.


Further information can be found on Github

Categories: ArduinoMachine Sound


Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *