speech4d

Cross-engine Text To Speech (TTS) interface.

This module publicly imports the system default engine implementation of this interface. Currently, the default engine is Microsoft Speech API (SAPI) on Windows, and eSpeak for every other platform.

Only cross-platform features are documented here. Documentation for implementation-specific features can be found in their respective modules.


struct Synthesizer;

Speech synthesizer for Text To Speech.


static Synthesizer create();

Create a new speech synthesis interface using the system default voice.


void speak(in char[] text);
void speak(in wchar[] text);

Speak a string of text.


alias put = speak;

Synthesizer is an OutputRange of strings.


@property void voice(Voice newVoice);
@property Voice voice();

Voice to use for speech synthesis.


@property void volume(uint newVolume);
@property uint volume();

Volume of speech playback in the range 0-100.


@property void rate(int newRate);
@property int rate();

Rate of speech synthesis.


struct Voice;

Represents a single voice to use with speech synthesis.


@property string name();

Name of this voice.


auto voiceList();

Get an InputRange of Voice enumerating all voices installed on the system.