1 /**
2 * Cross-engine Text To Speech (TTS) interface.
3 *
4 * This module publicly imports the system default engine implementation of this interface.
5 * Currently, the default engine is Microsoft Speech API (SAPI) on Windows, and eSpeak for
6 * every other platform.
7 *
8 * Only cross-platform features are documented here. Documentation for implementation-specific
9 * features can be found in their respective modules.
10 */11 modulespeech.synthesis;
12 13 version(Windows)
14 {
15 publicimportspeech.windows.synthesis;
16 }
17 else18 {
19 publicimportspeech.espeak.synthesis;
20 }
21 22 version(speech4d_ddoc):
23 24 /// Speech synthesizer for Text To Speech.25 structSynthesizer26 {
27 /// Create a new speech synthesis interface using the system default voice.28 staticSynthesizercreate();
29 30 /// Speak a string of text.31 voidspeak(inchar[] text);
32 33 /// Ditto34 voidspeak(inwchar[] text);
35 36 /// Synthesizer is an $(D OutputRange) of strings.37 aliasput = speak;
38 39 /// Voice to use for speech synthesis.40 voidvoice(VoicenewVoice) @property;
41 42 /// Ditto43 Voicevoice() @property;
44 45 /// Volume of speech playback in the range 0-100.46 voidvolume(uintnewVolume) @property;
47 48 /// Ditto49 uintvolume() @property;
50 51 /// Rate of speech synthesis.52 voidrate(intnewRate) @property;
53 54 /// Ditto55 intrate() @property;
56 }
57 58 /// Represents a single voice to use with speech synthesis.59 structVoice60 {
61 /// Name of this voice.62 stringname() @property;
63 }
64 65 /// Get an $(D InputRange) of $(D Voice) enumerating all voices installed on the system.66 autovoiceList() {}
67