mirror of
https://github.com/D-Modem/speaking-clock.git
synced 2026-11-28 12:38:05 -08:00
Merge pull request #2 from D-Modem/claude/project-thread-cuc3tg
Add synthesiser voices and a live speech mode
This commit is contained in:
910 files changed
+3713
-101
No files matched your search
@@ -1,3 +1,4 @@
|
||||
asterisk/app_speakingclock.so
|
||||
/sources/
|
||||
__pycache__/
|
||||
synth/mssam/mssam
|
||||
@@ -63,3 +63,36 @@ subject to the terms of the engines that produced them.
|
||||
From [garrysblog/Speaking-Clock-MP3-Files](https://github.com/garrysblog/Speaking-Clock-MP3-Files),
|
||||
made with an online text-to-speech service for an Arduino clock. Its README
|
||||
says the files are "free to download and use in your own projects".
|
||||
|
||||
### Speech synthesisers (`voices/sapi4-*`, `voices/dectalk-*`, `voices/sam-*`, `voices/mac-*`)
|
||||
Made by `tools/synth_voices.py`, which has each synthesiser speak every
|
||||
phrase and number the clock needs. The synthesisers, and the sound of their
|
||||
voices, belong to their owners:
|
||||
|
||||
- **SAPI4 voices** (`sapi4-*`): Microsoft Sam, Mike and Mary (Microsoft
|
||||
Speech API 4.0), Lernout & Hauspie TruVoice and TTS3000, and RoboSoft.
|
||||
They were spoken by the public SAPI4 service at <https://www.tetyys.com/SAPI4/>,
|
||||
which runs Microsoft's SAPI4 runtime and voices. Microsoft, Lernout &
|
||||
Hauspie and BonziBUDDY are trademarks of their owners. The `bonzibuddy`
|
||||
voice is TruVoice Adult Male #2 at the pitch and speed BonziBUDDY used.
|
||||
The live voices (`live-*`) hold no recordings: each sentence is spoken
|
||||
when it is needed, by DECtalk or SAM on the Asterisk machine.
|
||||
- **Microsoft Sam, Mike and Mary (and for telephone), live** (`live-mssam-*`): no recordings.
|
||||
Each sentence is spoken on the Asterisk machine by `synth/mssam`, our own
|
||||
synthesiser (GPL-2.0-or-later, like the rest of this repository), which
|
||||
reads the voice data of Microsoft's Speech API 4 voices. That data is
|
||||
Microsoft's and is not in this repository: `tools/fetch-mssam.py`
|
||||
downloads Microsoft's package (msttsl.exe) from the Internet Archive and
|
||||
keeps only the voice data, none of Microsoft's programs. Microsoft is a
|
||||
trademark of Microsoft Corporation. The word list in
|
||||
`synth/mssam/lexicon.h`, and the `cmudict.dict` the fetch script
|
||||
downloads, are from the CMU Pronouncing Dictionary, © 1993-2015 Carnegie
|
||||
Mellon University, under its BSD-style licence (in `lexicon.h`).
|
||||
- **DECtalk** (`dectalk-*`): DECtalk 4.x, made by Digital Equipment
|
||||
Corporation and later Fonix. Built from the source at
|
||||
<https://github.com/dectalk/dectalk>.
|
||||
- **SAM** (`sam-*`): Software Automatic Mouth, Don't Ask Software, 1982 (now
|
||||
SoftVoice, Inc.). Built from the C port at <https://github.com/s-macke/SAM>.
|
||||
- **MacInTalk and PlainTalk** (`mac-*`): Apple's voices (MacinTalk 3, and
|
||||
the PlainTalk MacinTalk Pro voices Victoria, Agnes, Bruce and Vicki),
|
||||
spoken by macOS's `say`.
|
||||
@@ -1,8 +1,10 @@
|
||||
# speaking-clock
|
||||
|
||||
A telephone speaking clock for Asterisk and FreePBX, with 81 voices: the UK's
|
||||
TIM (Pat Simmons), Australia's Gordon Gow, and the whole Steve's Talking
|
||||
Clock library of talking clocks, watches and speech synthesisers.
|
||||
A telephone speaking clock for Asterisk and FreePBX. Its voices include the
|
||||
UK's TIM (Pat Simmons), Australia's Gordon Gow, the whole Steve's Talking
|
||||
Clock library of talking clocks and watches, and classic speech synthesisers
|
||||
(Microsoft Sam and the other SAPI4 voices, DECtalk, SAM, MacInTalk, PlainTalk), each
|
||||
able to give the time to the second.
|
||||
|
||||
- **`asterisk/`**: `app_speakingclock`, the `SpeakingClock()` dialplan
|
||||
application, written in C.
|
||||
@@ -66,6 +68,28 @@ Asterisk logs "Couldn't find application SpeakingClock in XML
|
||||
documentation" because a module built outside Asterisk's tree has no XML
|
||||
docs installed. The warning does no harm.
|
||||
|
||||
## Live voices
|
||||
|
||||
A voice with `mode=tts` has no clips. The module runs a synthesiser on the
|
||||
Asterisk machine for each announcement's whole sentence ("At the third
|
||||
stroke, it will be four fifteen and twenty seconds."), a little ahead of
|
||||
when it is needed, so the call never waits on it. The `live-dectalk-*` and
|
||||
`live-sam-*` voices run DECtalk's `say` and `sam`. Set where they are in
|
||||
speakingclock.conf:
|
||||
|
||||
```
|
||||
tts_program_dectalk=/opt/dectalk/say
|
||||
tts_program_sam=/usr/local/bin/sam
|
||||
```
|
||||
|
||||
The `live-mssam-*` voices (Microsoft Sam, Mike and Mary, and Mike and Mary
|
||||
for telephone) run
|
||||
[synth/mssam](synth/mssam), our own synthesiser, which reads Microsoft's
|
||||
voice data (`cd synth/mssam && make && make voices && sudo make install`
|
||||
builds it and fetches the data). Its setting is `tts_program_mssam`.
|
||||
|
||||
See [docs/voice-format.md](docs/voice-format.md#live-voices-modetts).
|
||||
|
||||
## FreePBX
|
||||
|
||||
Pack `freepbx/speakingclock` into a tarball and install it with Module Admin
|
||||
@@ -82,6 +106,21 @@ tools/fetch-sources.sh sources # curl, git, unzip, 7z or innoextract
|
||||
tools/build_voices.py sources voices # ffmpeg
|
||||
```
|
||||
|
||||
The synthesiser voices come from `tools/synth_voices.py`. It has the
|
||||
synthesiser speak every clip on its own (a whole number, "and twenty
|
||||
seconds", "At the third stroke, it will be"), so they are `tim` voices that
|
||||
give the time to the second, with the module making the pips:
|
||||
|
||||
```sh
|
||||
tools/synth_voices.py --list # the voices it knows
|
||||
tools/synth_voices.py voices sapi4:microsoft-sam # SAPI4, via tetyys.com
|
||||
DECTALK_SAY=~/dectalk/dist/say tools/synth_voices.py voices dectalk:paul
|
||||
SAM=~/SAM/sam tools/synth_voices.py voices sam:sam
|
||||
MSSAM=synth/mssam/mssam tools/synth_voices.py --live voices mssam:sam # live-mssam-sam
|
||||
tools/synth_voices.py voices mac:Fred # MacInTalk, on a Mac
|
||||
tools/synth_voices.py voices mac:Victoria # PlainTalk, on a Mac
|
||||
```
|
||||
|
||||
## Licence
|
||||
|
||||
The code is licensed under the GPL, version 2 or (at your option) any later
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
#include "asterisk.h"
|
||||
|
||||
#include <dirent.h>
|
||||
#include <spawn.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/stat.h>
|
||||
#include <math.h>
|
||||
|
||||
@@ -101,7 +105,7 @@
|
||||
|
||||
static const char app[] = "SpeakingClock";
|
||||
|
||||
enum mode { MODE_TALKING, MODE_TIM, MODE_CHIME, MODE_HOURLY };
|
||||
enum mode { MODE_TALKING, MODE_TIM, MODE_CHIME, MODE_HOURLY, MODE_TTS };
|
||||
|
||||
struct clip {
|
||||
char name[48];
|
||||
@@ -117,6 +121,8 @@ struct voice {
|
||||
int period; /* seconds */
|
||||
double marker; /* seconds into the pips of the time mark, <0: none */
|
||||
int int24; /* 24-hour clock */
|
||||
char tts_command[512]; /* mode=tts: the program that speaks it */
|
||||
char tts_text[512]; /* mode=tts: what to say */
|
||||
size_t nclips;
|
||||
struct clip clips[];
|
||||
};
|
||||
@@ -228,13 +234,15 @@ static enum mode mode_parse(const char *s)
|
||||
return MODE_CHIME;
|
||||
} else if (!strcasecmp(s, "hourly")) {
|
||||
return MODE_HOURLY;
|
||||
} else if (!strcasecmp(s, "tts")) {
|
||||
return MODE_TTS;
|
||||
}
|
||||
return MODE_TALKING;
|
||||
}
|
||||
|
||||
static const char *mode_name(enum mode m)
|
||||
{
|
||||
static const char *names[] = { "talking", "tim", "chime", "hourly" };
|
||||
static const char *names[] = { "talking", "tim", "chime", "hourly", "tts" };
|
||||
return names[m];
|
||||
}
|
||||
|
||||
@@ -296,6 +304,13 @@ static struct voice *voice_load(const char *dir, const char *id)
|
||||
v->int24 = atoi(var->value) == 24;
|
||||
}
|
||||
}
|
||||
for (var = ast_variable_browse(cfg, "tts"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "command")) {
|
||||
ast_copy_string(v->tts_command, var->value, sizeof(v->tts_command));
|
||||
} else if (!strcasecmp(var->name, "text")) {
|
||||
ast_copy_string(v->tts_text, var->value, sizeof(v->tts_text));
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
}
|
||||
|
||||
@@ -319,13 +334,24 @@ static struct voice *voice_load(const char *dir, const char *id)
|
||||
[MODE_TIM] = "phrase+hour+minute+seconds+pips",
|
||||
[MODE_CHIME] = "quarter+strikes",
|
||||
[MODE_HOURLY] = "hourly",
|
||||
[MODE_TTS] = "speech+pips",
|
||||
};
|
||||
ast_copy_string(v->sequence, seq[v->mode], sizeof(v->sequence));
|
||||
}
|
||||
if (v->period <= 0) {
|
||||
v->period = v->mode == MODE_CHIME ? 30 : 10;
|
||||
}
|
||||
if (!v->nclips) {
|
||||
if (v->mode == MODE_TTS) {
|
||||
if (ast_strlen_zero(v->tts_text)) {
|
||||
ast_copy_string(v->tts_text, "At the third stroke, it will be {hour} {minute} {seconds}.",
|
||||
sizeof(v->tts_text));
|
||||
}
|
||||
if (ast_strlen_zero(v->tts_command)) {
|
||||
ast_log(LOG_WARNING, "SpeakingClock: tts voice '%s' has no [tts] command=\n", id);
|
||||
ao2_ref(v, -1);
|
||||
return NULL;
|
||||
}
|
||||
} else if (!v->nclips) {
|
||||
ast_log(LOG_WARNING, "SpeakingClock: voice '%s' has no usable clips\n", id);
|
||||
ao2_ref(v, -1);
|
||||
return NULL;
|
||||
@@ -357,6 +383,499 @@ static struct voice *voice_get(const char *id)
|
||||
return v;
|
||||
}
|
||||
|
||||
/* ---- live speech (mode=tts) -------------------------------------------- *
|
||||
* A tts voice has no number clips. Each announcement's sentence is spoken
|
||||
* whole by a synthesiser program on this machine (DECtalk, SAM), converted
|
||||
* to 8 kHz, and cached. A worker thread runs the program, so a call never
|
||||
* waits on it: the clock asks for an announcement two periods before it is
|
||||
* due, and one whose speech isn't ready in time plays without it (pips
|
||||
* only). */
|
||||
|
||||
#define SPEECH_SLOTS 128
|
||||
#define SPEECH_RETRY 30 /* seconds before a failed fetch is tried again */
|
||||
#define SPEECH_MAX (8 << 20) /* largest WAV accepted */
|
||||
|
||||
enum speech_state { SP_EMPTY, SP_WANTED, SP_FETCHING, SP_READY, SP_FAILED };
|
||||
|
||||
struct speech {
|
||||
char *key;
|
||||
enum speech_state state;
|
||||
int16_t *s;
|
||||
size_t n;
|
||||
time_t used, failed;
|
||||
unsigned long seq; /* order asked for */
|
||||
};
|
||||
|
||||
AST_MUTEX_DEFINE_STATIC(speech_lock);
|
||||
static ast_cond_t speech_cond; /* work for the fetcher, or a fetch done */
|
||||
static struct speech speech[SPEECH_SLOTS];
|
||||
static unsigned long speech_seq;
|
||||
static pthread_t speech_thread = AST_PTHREADT_NULL;
|
||||
static int speech_quit;
|
||||
#define TTS_PROGRAMS 32
|
||||
/* tts_program_<name> from speakingclock.conf */
|
||||
static struct { char name[48]; char path[256]; } tts_programs[TTS_PROGRAMS];
|
||||
static int ntts_programs;
|
||||
|
||||
/* The tts_<kind>_<name> setting, else def. */
|
||||
static void tts_setting(const char *kind, const char *name, size_t nlen, const char *def,
|
||||
char *out, size_t len)
|
||||
{
|
||||
char key[48];
|
||||
int i;
|
||||
snprintf(key, sizeof(key), "%s_%.*s", kind, (int) MIN(nlen, 30), name);
|
||||
ast_copy_string(out, def, len);
|
||||
ast_mutex_lock(&conf_lock);
|
||||
for (i = 0; i < ntts_programs; i++) {
|
||||
if (!strcasecmp(tts_programs[i].name, key)) {
|
||||
ast_copy_string(out, tts_programs[i].path, len);
|
||||
}
|
||||
}
|
||||
ast_mutex_unlock(&conf_lock);
|
||||
}
|
||||
static int tts_timeout = 15;
|
||||
|
||||
/* Windowed-sinc resampling to 8 kHz, with the cut-off below both Nyquists. */
|
||||
static int16_t *resample(const float *x, size_t n, unsigned rate, size_t *out_n)
|
||||
{
|
||||
double ratio = (double) rate / RATE, fc = 0.45 * MIN(1.0, 1.0 / ratio);
|
||||
int w = (int) ceil(12 / fc);
|
||||
size_t k, m = (size_t) (n / ratio);
|
||||
int16_t *y = ast_malloc((m ? m : 1) * sizeof(int16_t));
|
||||
|
||||
if (!y) {
|
||||
return NULL;
|
||||
}
|
||||
for (k = 0; k < m; k++) {
|
||||
double t = k * ratio, acc = 0;
|
||||
long i, c = (long) floor(t);
|
||||
for (i = c - w + 1; i <= c + w; i++) {
|
||||
double d = t - i, h;
|
||||
if (i < 0 || i >= (long) n) {
|
||||
continue;
|
||||
}
|
||||
h = d == 0 ? 2 * fc : sin(2 * M_PI * fc * d) / (M_PI * d);
|
||||
acc += x[i] * h * (0.5 + 0.5 * cos(M_PI * d / w));
|
||||
}
|
||||
acc = acc > 32767 ? 32767 : acc < -32768 ? -32768 : acc;
|
||||
y[k] = (int16_t) lrint(acc);
|
||||
}
|
||||
*out_n = m;
|
||||
return y;
|
||||
}
|
||||
|
||||
/* A PCM WAV of any rate, 8 or 16 bits, mono or stereo: to 8 kHz mono,
|
||||
* with the silence around it trimmed (40 ms left each side) and its peak
|
||||
* brought to -3 dBFS, the way tools/synth_voices.py makes clips. */
|
||||
static int16_t *speech_decode(const unsigned char *d, size_t len, size_t *out_n)
|
||||
{
|
||||
const unsigned char *fmt = NULL, *data = NULL;
|
||||
size_t dlen = 0, pos = 12, i, frames, a, b, n;
|
||||
unsigned ch, rate, bits;
|
||||
float *x;
|
||||
int16_t *y;
|
||||
int peak = 0;
|
||||
|
||||
if (len < 12 || memcmp(d, "RIFF", 4) || memcmp(d + 8, "WAVE", 4)) {
|
||||
return NULL;
|
||||
}
|
||||
while (pos + 8 <= len) {
|
||||
size_t clen = le32(d + pos + 4);
|
||||
if (!memcmp(d + pos, "fmt ", 4) && clen >= 16 && pos + 8 + 16 <= len) {
|
||||
fmt = d + pos + 8;
|
||||
} else if (!memcmp(d + pos, "data", 4)) {
|
||||
data = d + pos + 8;
|
||||
dlen = MIN(clen, len - pos - 8); /* streamed WAVs give no length */
|
||||
break;
|
||||
}
|
||||
pos += 8 + clen + (clen & 1);
|
||||
}
|
||||
if (!fmt || !data) {
|
||||
return NULL;
|
||||
}
|
||||
ch = fmt[2] | fmt[3] << 8;
|
||||
rate = le32(fmt + 4);
|
||||
bits = fmt[14] | fmt[15] << 8;
|
||||
if (!((fmt[0] == 1 && !fmt[1]) || (fmt[0] == 0xfe && fmt[1] == 0xff)) ||
|
||||
ch < 1 || ch > 2 || (bits != 8 && bits != 16) || rate < 4000 || rate > 96000) {
|
||||
return NULL;
|
||||
}
|
||||
frames = dlen / (ch * bits / 8);
|
||||
if (!(x = ast_malloc((frames ? frames : 1) * sizeof(float)))) {
|
||||
return NULL;
|
||||
}
|
||||
for (i = 0; i < frames; i++) {
|
||||
float v = 0;
|
||||
unsigned c;
|
||||
for (c = 0; c < ch; c++) {
|
||||
const unsigned char *p = data + (i * ch + c) * (bits / 8);
|
||||
v += bits == 8 ? (p[0] - 128) * 256 : (int16_t) (p[0] | p[1] << 8);
|
||||
}
|
||||
x[i] = v / ch;
|
||||
}
|
||||
if (rate == RATE) {
|
||||
n = frames;
|
||||
y = ast_malloc((n ? n : 1) * sizeof(int16_t));
|
||||
for (i = 0; y && i < n; i++) {
|
||||
y[i] = (int16_t) x[i];
|
||||
}
|
||||
} else {
|
||||
y = resample(x, frames, rate, &n);
|
||||
}
|
||||
ast_free(x);
|
||||
if (!y) {
|
||||
return NULL;
|
||||
}
|
||||
for (i = 0; i < n; i++) {
|
||||
peak = MAX(peak, abs(y[i]));
|
||||
}
|
||||
if (peak < 100) {
|
||||
ast_free(y);
|
||||
return NULL; /* silence */
|
||||
}
|
||||
for (a = 0; a < n && abs(y[a]) < peak / 30; a++) {
|
||||
}
|
||||
for (b = n; b > a && abs(y[b - 1]) < peak / 30; b--) {
|
||||
}
|
||||
a = a > RATE / 25 ? a - RATE / 25 : 0;
|
||||
b = MIN(n, b + RATE / 25);
|
||||
for (i = a; i < b; i++) {
|
||||
y[i - a] = (int16_t) (y[i] * 23197.0 / peak);
|
||||
}
|
||||
*out_n = b - a;
|
||||
return y;
|
||||
}
|
||||
|
||||
/* Run a speech program: key is "exec:" and its arguments, split by \x1f.
|
||||
* It writes the WAV to the file named by the argument "{out}", or else to
|
||||
* its standard output. No shell: the text is one argument. */
|
||||
static int16_t *speech_exec(const char *key, size_t *n)
|
||||
{
|
||||
char tmpl[] = "/tmp/speakingclock-XXXXXX.wav", *args, *argv[64], *a;
|
||||
int fd, argc = 0, status = -1, to_file = 0;
|
||||
posix_spawn_file_actions_t fa;
|
||||
unsigned char *d = NULL;
|
||||
int16_t *s = NULL;
|
||||
struct stat sb;
|
||||
time_t until;
|
||||
pid_t pid;
|
||||
|
||||
if ((fd = mkstemps(tmpl, 4)) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
args = ast_strdupa(key + 5);
|
||||
while ((a = strsep(&args, "\x1f")) && argc < 63) {
|
||||
if (!strcmp(a, "{out}")) {
|
||||
argv[argc++] = tmpl;
|
||||
to_file = 1;
|
||||
} else {
|
||||
argv[argc++] = a;
|
||||
}
|
||||
}
|
||||
argv[argc] = NULL;
|
||||
posix_spawn_file_actions_init(&fa);
|
||||
posix_spawn_file_actions_addopen(&fa, 0, "/dev/null", O_RDONLY, 0);
|
||||
if (to_file) {
|
||||
posix_spawn_file_actions_addopen(&fa, 1, "/dev/null", O_WRONLY, 0);
|
||||
} else {
|
||||
posix_spawn_file_actions_adddup2(&fa, fd, 1);
|
||||
}
|
||||
posix_spawn_file_actions_addopen(&fa, 2, "/dev/null", O_WRONLY, 0);
|
||||
/* Asterisk ignores SIGCHLD; it must not, to wait for the child */
|
||||
ast_replace_sigchld();
|
||||
if (argc && !posix_spawnp(&pid, argv[0], &fa, NULL, argv, environ)) {
|
||||
pid_t w;
|
||||
until = time(NULL) + tts_timeout;
|
||||
while ((w = waitpid(pid, &status, WNOHANG)) == 0) {
|
||||
if (time(NULL) > until) {
|
||||
kill(pid, SIGKILL);
|
||||
waitpid(pid, &status, 0);
|
||||
ast_log(LOG_WARNING, "SpeakingClock: %s took too long\n", argv[0]);
|
||||
status = -1;
|
||||
break;
|
||||
}
|
||||
usleep(20000);
|
||||
}
|
||||
if (w < 0) {
|
||||
status = -1;
|
||||
}
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "SpeakingClock: can't run %s\n", argc ? argv[0] : "(nothing)");
|
||||
}
|
||||
ast_unreplace_sigchld();
|
||||
posix_spawn_file_actions_destroy(&fa);
|
||||
if (status == 0 && !stat(tmpl, &sb) && sb.st_size > 0 && sb.st_size < SPEECH_MAX &&
|
||||
(d = ast_malloc(sb.st_size))) {
|
||||
FILE *f = fopen(tmpl, "rb");
|
||||
if (f && fread(d, 1, sb.st_size, f) == (size_t) sb.st_size &&
|
||||
!(s = speech_decode(d, sb.st_size, n))) {
|
||||
ast_log(LOG_WARNING, "SpeakingClock: %s: not a WAV file it can read\n", argv[0]);
|
||||
}
|
||||
if (f) {
|
||||
fclose(f);
|
||||
}
|
||||
} else if (status > 0) {
|
||||
ast_log(LOG_WARNING, "SpeakingClock: %s failed (%d)\n", argv[0], status);
|
||||
}
|
||||
ast_free(d);
|
||||
close(fd);
|
||||
unlink(tmpl);
|
||||
return s;
|
||||
}
|
||||
|
||||
static void *speech_worker(void *unused)
|
||||
{
|
||||
ast_mutex_lock(&speech_lock);
|
||||
while (!speech_quit) {
|
||||
struct speech *e = NULL;
|
||||
char *key;
|
||||
int16_t *s;
|
||||
size_t i, n = 0;
|
||||
|
||||
for (i = 0; i < SPEECH_SLOTS; i++) {
|
||||
if (speech[i].state == SP_WANTED && (!e || speech[i].seq < e->seq)) {
|
||||
e = &speech[i];
|
||||
}
|
||||
}
|
||||
if (!e) {
|
||||
ast_cond_wait(&speech_cond, &speech_lock);
|
||||
continue;
|
||||
}
|
||||
e->state = SP_FETCHING;
|
||||
key = ast_strdup(e->key);
|
||||
ast_mutex_unlock(&speech_lock);
|
||||
s = key ? speech_exec(key, &n) : NULL;
|
||||
ast_mutex_lock(&speech_lock);
|
||||
/* the slot is never reused while it is fetching */
|
||||
e->s = s;
|
||||
e->n = n;
|
||||
e->state = s ? SP_READY : SP_FAILED;
|
||||
e->failed = time(NULL);
|
||||
ast_free(key);
|
||||
ast_cond_broadcast(&speech_cond);
|
||||
}
|
||||
ast_mutex_unlock(&speech_lock);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
enum { SPEECH_PEEK, SPEECH_ASK, SPEECH_WAIT };
|
||||
|
||||
/* The speech for key, copied into *s (the caller frees it): 0 when it's
|
||||
* here, -1 when it isn't (yet). SPEECH_ASK asks for it if it hasn't been
|
||||
* asked for, SPEECH_WAIT also waits up to the fetch timeout for it, and
|
||||
* SPEECH_PEEK only looks. */
|
||||
static int speech_get(const char *key, int16_t **s, size_t *n, int how)
|
||||
{
|
||||
struct speech *e = NULL, *victim = NULL;
|
||||
time_t now = time(NULL);
|
||||
struct timeval until = ast_tvadd(ast_tvnow(), ast_samp2tv(tts_timeout + 5, 1));
|
||||
size_t i;
|
||||
int res = -1;
|
||||
|
||||
ast_mutex_lock(&speech_lock);
|
||||
for (i = 0; i < SPEECH_SLOTS && !e; i++) {
|
||||
if (speech[i].state != SP_EMPTY && !strcmp(speech[i].key, key)) {
|
||||
e = &speech[i];
|
||||
}
|
||||
}
|
||||
if (!e && how != SPEECH_PEEK) {
|
||||
/* an empty slot, else the one least recently used */
|
||||
for (i = 0; i < SPEECH_SLOTS; i++) {
|
||||
struct speech *c = &speech[i];
|
||||
if (c->state == SP_FETCHING) {
|
||||
continue;
|
||||
}
|
||||
if (c->state == SP_EMPTY) {
|
||||
victim = c;
|
||||
break;
|
||||
}
|
||||
if (!victim || c->used < victim->used) {
|
||||
victim = c;
|
||||
}
|
||||
}
|
||||
if (victim) {
|
||||
ast_free(victim->key);
|
||||
ast_free(victim->s);
|
||||
memset(victim, 0, sizeof(*victim));
|
||||
if ((victim->key = ast_strdup(key))) {
|
||||
e = victim;
|
||||
e->state = SP_WANTED;
|
||||
e->seq = ++speech_seq;
|
||||
ast_cond_broadcast(&speech_cond);
|
||||
}
|
||||
}
|
||||
} else if (e && how != SPEECH_PEEK && e->state == SP_FAILED && now - e->failed >= SPEECH_RETRY) {
|
||||
e->state = SP_WANTED;
|
||||
e->seq = ++speech_seq;
|
||||
ast_cond_broadcast(&speech_cond);
|
||||
}
|
||||
while (e && how == SPEECH_WAIT && (e->state == SP_WANTED || e->state == SP_FETCHING)) {
|
||||
struct timespec ts = { .tv_sec = until.tv_sec, .tv_nsec = until.tv_usec * 1000 };
|
||||
if (ast_cond_timedwait(&speech_cond, &speech_lock, &ts) && ast_tvcmp(ast_tvnow(), until) >= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (e && e->key && strcmp(e->key, key)) {
|
||||
e = NULL; /* reused for another while we waited */
|
||||
}
|
||||
if (e) {
|
||||
e->used = now;
|
||||
if (e->state == SP_READY && (*s = ast_malloc(e->n * sizeof(int16_t)))) {
|
||||
memcpy(*s, e->s, e->n * sizeof(int16_t));
|
||||
*n = e->n;
|
||||
res = 0;
|
||||
}
|
||||
}
|
||||
ast_mutex_unlock(&speech_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
static void speech_start(void)
|
||||
{
|
||||
ast_cond_init(&speech_cond, NULL);
|
||||
speech_quit = 0;
|
||||
if (ast_pthread_create_background(&speech_thread, NULL, speech_worker, NULL)) {
|
||||
speech_thread = AST_PTHREADT_NULL;
|
||||
ast_log(LOG_ERROR, "SpeakingClock: can't start the speech fetcher\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void speech_stop(void)
|
||||
{
|
||||
size_t i;
|
||||
if (speech_thread != AST_PTHREADT_NULL) {
|
||||
ast_mutex_lock(&speech_lock);
|
||||
speech_quit = 1;
|
||||
ast_cond_broadcast(&speech_cond);
|
||||
ast_mutex_unlock(&speech_lock);
|
||||
pthread_join(speech_thread, NULL);
|
||||
speech_thread = AST_PTHREADT_NULL;
|
||||
}
|
||||
for (i = 0; i < SPEECH_SLOTS; i++) {
|
||||
ast_free(speech[i].key);
|
||||
ast_free(speech[i].s);
|
||||
memset(&speech[i], 0, sizeof(speech[i]));
|
||||
}
|
||||
ast_cond_destroy(&speech_cond);
|
||||
}
|
||||
|
||||
/* ---- what a tts voice says ---- */
|
||||
|
||||
static const char *ones[] = { "zero", "one", "two", "three", "four", "five", "six",
|
||||
"seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen",
|
||||
"fifteen", "sixteen", "seventeen", "eighteen", "nineteen" };
|
||||
static const char *tens[] = { "", "", "twenty", "thirty", "forty", "fifty" };
|
||||
|
||||
static void words(int n, char *out, size_t len)
|
||||
{
|
||||
if (n < 20) {
|
||||
ast_copy_string(out, ones[n], len);
|
||||
} else if (n % 10) {
|
||||
snprintf(out, len, "%s-%s", tens[n / 10], ones[n % 10]);
|
||||
} else {
|
||||
ast_copy_string(out, tens[n / 10], len);
|
||||
}
|
||||
}
|
||||
|
||||
/* The template with {hour} {minute} {seconds} {ampm} {greeting} in words,
|
||||
* and {H} {HH} {M} {MM} {S} {SS} in digits, filled in. */
|
||||
static void tts_text(const char *tpl, const struct ast_tm *tm, int int24, char *out, size_t len)
|
||||
{
|
||||
struct ast_str *s = ast_str_alloca(1024);
|
||||
const char *p;
|
||||
|
||||
for (p = tpl; *p; p++) {
|
||||
char key[16], w[48];
|
||||
const char *close = *p == '{' ? strchr(p, '}') : NULL;
|
||||
if (!close || close - p - 1 >= (ptrdiff_t) sizeof(key)) {
|
||||
ast_str_append(&s, 0, "%c", *p);
|
||||
continue;
|
||||
}
|
||||
ast_copy_string(key, p + 1, close - p);
|
||||
p = close;
|
||||
w[0] = '\0';
|
||||
if (!strcmp(key, "hour")) {
|
||||
words(int24 ? tm->tm_hour : tm->tm_hour % 12 ? tm->tm_hour % 12 : 12, w, sizeof(w));
|
||||
} else if (!strcmp(key, "minute")) {
|
||||
if (!tm->tm_min) {
|
||||
ast_copy_string(w, int24 ? "hundred" : "o'clock", sizeof(w));
|
||||
} else if (tm->tm_min < 10) {
|
||||
snprintf(w, sizeof(w), "oh %s", ones[tm->tm_min]);
|
||||
} else {
|
||||
words(tm->tm_min, w, sizeof(w));
|
||||
}
|
||||
} else if (!strcmp(key, "seconds")) {
|
||||
if (!tm->tm_sec) {
|
||||
ast_copy_string(w, "precisely", sizeof(w));
|
||||
} else {
|
||||
char n[24];
|
||||
words(tm->tm_sec, n, sizeof(n));
|
||||
snprintf(w, sizeof(w), "and %s second%s", n, tm->tm_sec == 1 ? "" : "s");
|
||||
}
|
||||
} else if (!strcmp(key, "ampm")) {
|
||||
ast_copy_string(w, int24 ? "" : tm->tm_hour < 12 ? "A.M." : "P.M.", sizeof(w));
|
||||
} else if (!strcmp(key, "greeting")) {
|
||||
ast_copy_string(w, tm->tm_hour < 12 ? "Good morning" :
|
||||
tm->tm_hour < 18 ? "Good afternoon" : "Good evening", sizeof(w));
|
||||
} else if (!strcmp(key, "H") || !strcmp(key, "HH")) {
|
||||
int h = int24 ? tm->tm_hour : tm->tm_hour % 12 ? tm->tm_hour % 12 : 12;
|
||||
snprintf(w, sizeof(w), key[1] ? "%02d" : "%d", h);
|
||||
} else if (!strcmp(key, "M") || !strcmp(key, "MM")) {
|
||||
snprintf(w, sizeof(w), key[1] ? "%02d" : "%d", tm->tm_min);
|
||||
} else if (!strcmp(key, "S") || !strcmp(key, "SS")) {
|
||||
snprintf(w, sizeof(w), key[1] ? "%02d" : "%d", tm->tm_sec);
|
||||
} else {
|
||||
snprintf(w, sizeof(w), "{%s}", key);
|
||||
}
|
||||
ast_str_append(&s, 0, "%s", w);
|
||||
}
|
||||
ast_copy_string(out, ast_str_buffer(s), len);
|
||||
}
|
||||
|
||||
/* The key that runs v's command= for text: its words, split like a shell
|
||||
* would (with "..." and '...'), {program:name} becoming tts_program_<name>
|
||||
* (else name), {text} the text and {out} the file to write. */
|
||||
static void tts_cmd(const struct voice *v, const char *text, char *out, size_t len)
|
||||
{
|
||||
struct ast_str *s = ast_str_alloca(2048);
|
||||
const char *p = v->tts_command;
|
||||
int args = 0;
|
||||
|
||||
ast_str_set(&s, 0, "exec:");
|
||||
while (*p) {
|
||||
char q = 0;
|
||||
while (*p == ' ' || *p == '\t') {
|
||||
p++;
|
||||
}
|
||||
if (!*p) {
|
||||
break;
|
||||
}
|
||||
if (args++) {
|
||||
ast_str_append(&s, 0, "\x1f");
|
||||
}
|
||||
for (; *p && (q || (*p != ' ' && *p != '\t')); p++) {
|
||||
if (!q && (*p == '"' || *p == '\'')) {
|
||||
q = *p;
|
||||
} else if (q && *p == q) {
|
||||
q = 0;
|
||||
} else if (!strncmp(p, "{text}", 6)) {
|
||||
ast_str_append(&s, 0, "%s", text);
|
||||
p += 5;
|
||||
} else if (!strncmp(p, "{program:", 9) && strchr(p, '}')) {
|
||||
const char *close = strchr(p, '}');
|
||||
char name[48], prog[256];
|
||||
ast_copy_string(name, p + 9, MIN(sizeof(name), (size_t) (close - p - 8)));
|
||||
tts_setting("program", name, strlen(name), name, prog, sizeof(prog));
|
||||
ast_str_append(&s, 0, "%s", prog);
|
||||
p = close;
|
||||
} else {
|
||||
ast_str_append(&s, 0, "%c", *p);
|
||||
}
|
||||
}
|
||||
}
|
||||
ast_copy_string(out, ast_str_buffer(s), len);
|
||||
}
|
||||
|
||||
/* ---- composing an announcement ---------------------------------------- */
|
||||
|
||||
struct piece {
|
||||
@@ -371,6 +890,8 @@ struct ann {
|
||||
int16_t *s;
|
||||
size_t n;
|
||||
int used;
|
||||
int pending; /* its speech hadn't arrived: render it again */
|
||||
long long tried; /* when it was last rendered (st->pos) */
|
||||
};
|
||||
|
||||
struct clock_state {
|
||||
@@ -382,6 +903,7 @@ struct clock_state {
|
||||
long long pos; /* next sample to send, counted from the epoch */
|
||||
long long min_start; /* 'w': skip announcements starting before this */
|
||||
long long last_sync;
|
||||
int wait_speech; /* CLI render: fetch speech before going on */
|
||||
struct ann r[NREND];
|
||||
int16_t pips[RATE * 3]; /* made-up pips, for voices without a pips clip */
|
||||
int16_t buf[AST_FRIENDLY_OFFSET / 2 + RATE];
|
||||
@@ -391,6 +913,10 @@ struct say {
|
||||
const struct voice *v;
|
||||
struct piece p[MAX_PIECES];
|
||||
int np;
|
||||
int16_t *own[MAX_PIECES]; /* speech, freed after rendering */
|
||||
int nown;
|
||||
int pending; /* speech that hasn't arrived yet */
|
||||
int how; /* SPEECH_PEEK, _ASK or _WAIT */
|
||||
};
|
||||
|
||||
static int add(struct say *s, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
||||
@@ -535,6 +1061,24 @@ static void compose(struct say *s, const char *sequence, const struct ast_tm *tm
|
||||
if (tm->tm_min == 0) {
|
||||
add(s, "hourchime1");
|
||||
}
|
||||
} else if (!strcasecmp(tok, "speech")) {
|
||||
char text[512], key[2048];
|
||||
int16_t *sp;
|
||||
size_t n;
|
||||
if (s->v->mode != MODE_TTS || s->np >= MAX_PIECES || s->nown >= MAX_PIECES) {
|
||||
continue;
|
||||
}
|
||||
tts_text(s->v->tts_text, tm, int24, text, sizeof(text));
|
||||
tts_cmd(s->v, text, key, sizeof(key));
|
||||
if (speech_get(key, &sp, &n, s->how)) {
|
||||
s->pending = 1;
|
||||
continue;
|
||||
}
|
||||
s->own[s->nown++] = sp;
|
||||
s->p[s->np].s = sp;
|
||||
s->p[s->np].n = n;
|
||||
s->p[s->np].is_pips = 0;
|
||||
s->np++;
|
||||
} else if (!strcasecmp(tok, "pips")) {
|
||||
if (add(s, "pips") && s->np < MAX_PIECES) {
|
||||
s->p[s->np].s = NULL; /* made-up pips */
|
||||
@@ -575,6 +1119,11 @@ static void render(struct clock_state *st, struct ann *r, long long j)
|
||||
size_t i, total = 0, at = 0, mark = 0;
|
||||
int marked = 0;
|
||||
|
||||
/* speech is fetched only for announcements that can still start in
|
||||
* time: one whose mark is less than 8 s off (about a sentence and the
|
||||
* pips) uses it only if it's already here */
|
||||
s.how = st->wait_speech ? SPEECH_WAIT :
|
||||
j * st->period * (long long) RATE < st->pos + 8 * RATE ? SPEECH_PEEK : SPEECH_ASK;
|
||||
ast_localtime(&tv, &tm, ast_strlen_zero(st->zone) ? NULL : st->zone);
|
||||
compose(&s, st->sequence, &tm, st->int24);
|
||||
for (i = 0; i < (size_t) s.np; i++) {
|
||||
@@ -593,18 +1142,23 @@ static void render(struct clock_state *st, struct ann *r, long long j)
|
||||
ast_free(r->s);
|
||||
r->j = j;
|
||||
r->used = 1;
|
||||
r->pending = s.pending;
|
||||
r->tried = st->pos;
|
||||
r->n = total;
|
||||
r->start = j * st->period * (long long) RATE - (marked ? (long long) mark : 0);
|
||||
r->s = ast_calloc(total ? total : 1, sizeof(int16_t));
|
||||
if (!r->s) {
|
||||
r->n = 0;
|
||||
return;
|
||||
total = 0;
|
||||
}
|
||||
for (i = 0; i < (size_t) s.np; i++) {
|
||||
for (i = 0; r->s && i < (size_t) s.np; i++) {
|
||||
const int16_t *src = s.p[i].is_pips == 2 ? st->pips : s.p[i].s;
|
||||
memcpy(r->s + at, src, s.p[i].n * sizeof(int16_t));
|
||||
at += s.p[i].n;
|
||||
}
|
||||
for (i = 0; i < (size_t) s.nown; i++) {
|
||||
ast_free(s.own[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static struct ann *ann_get(struct clock_state *st, long long j)
|
||||
@@ -612,7 +1166,22 @@ static struct ann *ann_get(struct clock_state *st, long long j)
|
||||
int i, oldest = 0;
|
||||
for (i = 0; i < NREND; i++) {
|
||||
if (st->r[i].used && st->r[i].j == j) {
|
||||
return &st->r[i];
|
||||
struct ann *r = &st->r[i];
|
||||
/* speech that was missing may be here now: try again, at most
|
||||
* every 200 ms, while the announcement hasn't started, and keep
|
||||
* the new one only if it can still start on time */
|
||||
if (r->pending && r->start > st->pos && st->pos - r->tried >= RATE / 5) {
|
||||
struct ann t = { 0 };
|
||||
render(st, &t, j);
|
||||
if (t.start >= st->pos) {
|
||||
ast_free(r->s);
|
||||
*r = t;
|
||||
} else {
|
||||
ast_free(t.s);
|
||||
r->tried = st->pos;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
if (!st->r[i].used || st->r[i].j < st->r[oldest].j) {
|
||||
oldest = i;
|
||||
@@ -944,6 +1513,7 @@ static char *cli_render(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a
|
||||
return CLI_FAILURE;
|
||||
}
|
||||
st->pos = start * RATE;
|
||||
st->wait_speech = 1;
|
||||
for (i = 0; i < seconds * 10; i++) {
|
||||
int16_t out[RATE / 10];
|
||||
fill(st, out, RATE / 10);
|
||||
@@ -966,9 +1536,12 @@ static int load_config(int reload)
|
||||
{
|
||||
struct ast_flags flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
||||
struct ast_config *cfg = ast_config_load(CONF, flags);
|
||||
struct ast_variable *var;
|
||||
const char *s;
|
||||
|
||||
if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
|
||||
/* the voices may have changed even if this file hasn't */
|
||||
ao2_callback(voices, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL);
|
||||
return 0;
|
||||
}
|
||||
ast_mutex_lock(&conf_lock);
|
||||
@@ -976,6 +1549,8 @@ static int load_config(int reload)
|
||||
ast_copy_string(default_voice, "tim-pat-simmons", sizeof(default_voice));
|
||||
default_zone[0] = '\0';
|
||||
maxduration = 180;
|
||||
ntts_programs = 0;
|
||||
tts_timeout = 15;
|
||||
if (cfg && cfg != CONFIG_STATUS_FILEINVALID) {
|
||||
if ((s = ast_variable_retrieve(cfg, "general", "voicedir"))) {
|
||||
ast_copy_string(voicedir, s, sizeof(voicedir));
|
||||
@@ -989,6 +1564,18 @@ static int load_config(int reload)
|
||||
if ((s = ast_variable_retrieve(cfg, "general", "maxduration"))) {
|
||||
maxduration = atoi(s);
|
||||
}
|
||||
if ((s = ast_variable_retrieve(cfg, "general", "tts_timeout")) && atoi(s) > 0) {
|
||||
tts_timeout = atoi(s);
|
||||
}
|
||||
for (var = ast_variable_browse(cfg, "general"); var; var = var->next) {
|
||||
if (!strncasecmp(var->name, "tts_program_", 12) && ntts_programs < TTS_PROGRAMS) {
|
||||
ast_copy_string(tts_programs[ntts_programs].name, var->name + 4,
|
||||
sizeof(tts_programs[0].name));
|
||||
ast_copy_string(tts_programs[ntts_programs].path, var->value,
|
||||
sizeof(tts_programs[0].path));
|
||||
ntts_programs++;
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
}
|
||||
ast_mutex_unlock(&conf_lock);
|
||||
@@ -1003,6 +1590,7 @@ static int unload_module(void)
|
||||
ast_cli_unregister_multiple(cli, ARRAY_LEN(cli));
|
||||
ao2_cleanup(voices);
|
||||
voices = NULL;
|
||||
speech_stop();
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1012,6 +1600,7 @@ static int load_module(void)
|
||||
if (!voices) {
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
}
|
||||
speech_start();
|
||||
load_config(0);
|
||||
ast_cli_register_multiple(cli, ARRAY_LEN(cli));
|
||||
if (ast_register_application_xml(app, clock_exec)) {
|
||||
|
||||
@@ -22,3 +22,15 @@
|
||||
|
||||
; Hang up after this many seconds (0: never). The d() option overrides it.
|
||||
;maxduration=180
|
||||
|
||||
; The live DECtalk and SAM voices run the synthesiser on this machine, with
|
||||
; no server. Default: dectalk and sam, found on the PATH.
|
||||
;tts_program_dectalk=/opt/dectalk/say
|
||||
;tts_program_sam=/usr/local/bin/sam
|
||||
|
||||
; Seconds a synthesiser program may take before it is stopped.
|
||||
;tts_timeout=15
|
||||
|
||||
; The live Microsoft Sam, Mike and Mary voices run synth/mssam (default:
|
||||
; mssam, found on the PATH).
|
||||
;tts_program_mssam=/usr/local/bin/mssam
|
||||
@@ -0,0 +1,96 @@
|
||||
# Microsoft Sam, Mike and Mary voice data
|
||||
|
||||
What synth/mssam reads, as we decoded it from the data alone. The voices
|
||||
come in Microsoft's Speech API 4 TTS package `msttsl.exe` (SHA-1
|
||||
d988cbb3e99bc9dd850defda939c06b81d9d4544), a cabinet holding `sam.vce`,
|
||||
`male.vce` (Mike) and `female.vce` (Mary), and `male8.vce` and `female8.vce`, Mike and Mary for
|
||||
telephone (`mike-tel`, `mary-tel`). Each `.vce` is an OLE compound
|
||||
file with these streams: `Inventory`, `TreeImage`, `PhoneFile`, `Senone`,
|
||||
`Cdb`, `VcHeader` (and `AltUnits` in Sam's). `tools/fetch-mssam.py`
|
||||
writes `Inventory` as `<voice>.inv`, `Cdb` as `<voice>.tones`, and
|
||||
`TreeImage` rewritten as `<voice>.tree`.
|
||||
|
||||
## Inventory (`.inv`, little-endian)
|
||||
|
||||
u32 rate (22050), order (20), nlsf (6), na (11), nb (13), 2 more
|
||||
nlsf tables, then na tables, then nb tables; each:
|
||||
u32 count, u32 dim, count*dim float32
|
||||
u32 nunits, u32 size, (nunits+1) u32 offsets, then the units
|
||||
|
||||
The 6 line-spectrum codebooks have 256 entries of 3, 3, 3, 3, 4 and 4
|
||||
values: one entry from each makes the 20 line spectral frequencies of a
|
||||
frame (in cycles per sample). The excitation codebooks have 128 entries;
|
||||
family A's 11 dims and family B's 13 dims each add up to 510, the points
|
||||
of one pitch period scaled to a fixed length.
|
||||
|
||||
The telephone voices are the same at 8000 Hz with order 12: 4 line-spectrum
|
||||
codebooks of 3 values, and 10 excitation codebooks in each family (dims 12,
|
||||
12, 16, 16, 16, 18, 24, 38, 46, 56, adding up to 254). Their unvoiced frame bytes
|
||||
(147-238) do not fit as lengths at 8 kHz; mssam plays those frames as 5 ms,
|
||||
which matches the units' recorded lengths (Senone) best.
|
||||
|
||||
A unit:
|
||||
|
||||
u32 n frames
|
||||
n frame headers voiced: 0x7f bytes (127 each) then a
|
||||
byte < 0x7f, adding up to the pitch
|
||||
period in samples; unvoiced: 0x80
|
||||
bytes then a byte > 0x80, the length
|
||||
is 128*(number of 0x80 - 1) + that byte
|
||||
n x 6 bytes (4 for telephone) line-spectrum codebook indices
|
||||
n float32 gains (the RMS of the frame's excitation)
|
||||
for each voiced frame the first frame of a voiced run: 11
|
||||
family A indices, the whole period;
|
||||
each later one: 13 family B indices,
|
||||
the change from the previous period
|
||||
|
||||
Unvoiced frames are noise. Unit 0 is empty; unit k+1 is senone k.
|
||||
|
||||
## TreeImage (big-endian)
|
||||
|
||||
A header with the path of the question file, then the questions (u32
|
||||
count, then name\0 and a 64-bit mask each), then `\\...\TREE2\0`,
|
||||
`tree\0`, u32 number of sounds n, n bytes (1: one state per sound), u32 n,
|
||||
n u32 (where each sound's senones end, counted from n), u32 the number of
|
||||
senones, then u32 total, 0, 18, 0xffffffff, the number of composite
|
||||
questions q, then q pairs of 64-bit masks, 8 more bytes, and one tree per
|
||||
sound.
|
||||
|
||||
A mask holds sound i at bit (i + 36) mod 64, and the four word positions at
|
||||
bits 32-35: begins a word, ends one, is a whole word, is inside one. A
|
||||
composite question (left, right) is true when the sound before is in
|
||||
`left`, this sound's word position is in `left`, and the sound after is in
|
||||
`right`.
|
||||
|
||||
A tree is u16 nodes, u16 leaves (nodes = 2*leaves - 1), then the nodes in
|
||||
order, node 0 first:
|
||||
|
||||
inner node u16 yes, u16 no, 0xffff, u16 question..., 0xffff
|
||||
leaf 0xffff, u16 k, u16 k
|
||||
|
||||
An inner node goes to `yes` when any of its questions is true. Leaf k of
|
||||
sound s is senone (the senones of the sounds before s) + k.
|
||||
|
||||
PhoneFile lists the sounds in order, one per line (Sam: 52, Mike and
|
||||
Mary: 58, with SILb and SILe for silence before and after).
|
||||
|
||||
`<voice>.tree` is the same in our own little-endian layout:
|
||||
|
||||
"MSSAMTR1", u32 sounds, u32 questions, u32 senones, u32 1
|
||||
questions x (u64 left, u64 right) sound i at bit i, positions at 60-63
|
||||
sounds x (char name[8], u32 first senone, u32 nodes, u32 first node)
|
||||
u32 nodes, u32 question refs
|
||||
nodes x (i32 yes, i32 no, u32 first ref, u32 refs) leaf: yes = -1, no = k
|
||||
refs x u16 question index
|
||||
|
||||
## Senone
|
||||
|
||||
u32 count, then 28-byte records: the sound's name (4 bytes), u32 0, u32
|
||||
the leaf number + 1, and four float32: the unit's mean length in ms, its
|
||||
spread, and two energies.
|
||||
|
||||
## Cdb (`.tones`)
|
||||
|
||||
Text: pitch per tone, as `H (179) on: m=129= sd=34=; off: m=141= ...`, the
|
||||
mean pitch in Hz where a vowel starts and ends. mssam uses `H` (accented),
|
||||
`_` (plain), `h]` and `_]` (the last vowel of a phrase).
|
||||
+45
-1
@@ -47,7 +47,7 @@ from `n20` plus `n3` when it doesn't.
|
||||
[voice]
|
||||
name=Pat Simmons
|
||||
description=UK GPO speaking clock (TIM), 1963-1985
|
||||
mode=tim ; tim | talking | chime | hourly
|
||||
mode=tim ; tim | talking | chime | hourly | tts
|
||||
sequence=phrase+hour+minute+seconds+pips
|
||||
period=10 ; seconds between announcements
|
||||
marker=2.2949 ; the time mark: this many seconds into pips.wav
|
||||
@@ -62,6 +62,7 @@ hours=12 ; or 24
|
||||
- `tim`: `phrase+hour+minute+seconds+pips`, every 10 s
|
||||
- `chime`: `quarter+strikes`, every 30 s
|
||||
- `hourly`: `hourly`, every 10 s
|
||||
- `tts`: `speech+pips`, every 10 s (see Live voices, below)
|
||||
- **sequence** lists what to say, joined by `+`. It can use the words in the
|
||||
table above (`intro`, `its`, `greeting`, `phrase`, `hour`, `minute`,
|
||||
`seconds`, `ampm`, `pips`, `quarter`, `strikes`, `hourly`, `hourchime`) or
|
||||
@@ -74,3 +75,46 @@ hours=12 ; or 24
|
||||
on its second. For made-up pips the mark is the third pip.
|
||||
`tools/build_voices.py` measures this from the clip (the onset of the last
|
||||
pip).
|
||||
|
||||
## Live voices (mode=tts)
|
||||
|
||||
A live voice has no number clips. Each announcement's sentence is spoken
|
||||
whole, when it is needed, by a synthesiser program on the Asterisk machine
|
||||
(DECtalk, SAM).
|
||||
|
||||
```
|
||||
[voice]
|
||||
name=DECtalk Perfect Paul, live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:dectalk} -fo {out} -a "[:np] {text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
```
|
||||
|
||||
- **command**: the program to run, split into words like a shell would
|
||||
(with `"..."` and `'...'`), but run without one, so the text is always a
|
||||
single argument. `{program:name}` becomes `tts_program_name` from
|
||||
speakingclock.conf (else `name`, found on the PATH), `{text}` the text,
|
||||
and an argument `{out}` a file for it to write the WAV to. Without `{out}`
|
||||
the WAV is read from its standard output.
|
||||
- **text**: what each announcement says. In words: `{hour}`, `{minute}`
|
||||
("oh five", "o'clock" on the hour, "hundred" on a 24-hour clock),
|
||||
`{seconds}` ("and twenty seconds", "precisely" on the minute), `{ampm}`
|
||||
("A.M.", "P.M."), `{greeting}` ("Good morning"). In digits: `{H}`,
|
||||
`{HH}`, `{M}`, `{MM}`, `{S}`, `{SS}`.
|
||||
- **sequence**: `speech` is the sentence. Clips in the voice's folder can be
|
||||
used as well (a `pips.wav`, an `intro.wav`).
|
||||
|
||||
The program's WAV can be any PCM: 8 or 16 bits, mono or stereo, any rate.
|
||||
The module converts it to 8 kHz, trims the silence around it and evens its
|
||||
level, and keeps the last 128 sentences. A worker thread runs the program,
|
||||
about 20 seconds before each sentence is due, so a call never waits on it.
|
||||
An announcement whose sentence isn't ready in time plays the pips alone,
|
||||
and a program that fails is tried again after 30 seconds. `tts_timeout`
|
||||
(default 15 s) stops a program that hangs.
|
||||
|
||||
`tools/synth_voices.py --live voices dectalk:<voice>` (or `sam:`) writes
|
||||
these voices (`live-dectalk-*`, `live-sam-*`).
|
||||
@@ -22,6 +22,8 @@ class Clock
|
||||
'default_voice' => 'tim-pat-simmons',
|
||||
'timezone' => '',
|
||||
'maxduration' => 180,
|
||||
'tts_program_dectalk' => '',
|
||||
'tts_program_sam' => '',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -62,6 +64,8 @@ class Clock
|
||||
'default_voice' => self::str($a, 'default_voice', $d['default_voice']),
|
||||
'timezone' => self::str($a, 'timezone'),
|
||||
'maxduration' => self::str($a, 'maxduration', (string)$d['maxduration']),
|
||||
'tts_program_dectalk' => self::str($a, 'tts_program_dectalk'),
|
||||
'tts_program_sam' => self::str($a, 'tts_program_sam'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -105,6 +109,9 @@ class Clock
|
||||
$e['timezone'] = _('Not a time zone');
|
||||
if (!preg_match('/^\d{1,6}$/', (string)$s['maxduration']))
|
||||
$e['maxduration'] = _('Seconds, 0 for no limit');
|
||||
foreach (['tts_program_dectalk', 'tts_program_sam'] as $k)
|
||||
if ($s[$k] !== '' && !preg_match('#^/[^\s;]*\z#', $s[$k]))
|
||||
$e[$k] = _('A full path, with no spaces');
|
||||
return $e;
|
||||
}
|
||||
|
||||
@@ -248,6 +255,9 @@ class Clock
|
||||
if ($s['timezone'] !== '')
|
||||
$o .= 'timezone=' . $s['timezone'] . "\n";
|
||||
$o .= 'maxduration=' . (int)$s['maxduration'] . "\n";
|
||||
foreach (['tts_program_dectalk', 'tts_program_sam'] as $k)
|
||||
if ($s[$k] !== '')
|
||||
$o .= $k . '=' . $s[$k] . "\n";
|
||||
return $o;
|
||||
}
|
||||
}
|
||||
@@ -24,5 +24,9 @@ include __DIR__ . '/_form.php';
|
||||
_('For clocks without one of their own.'));
|
||||
$row('maxduration', _('Hang up after (seconds)'), $text('maxduration', $s['maxduration']),
|
||||
_('How long a call may listen, 0 for no limit.'));
|
||||
$row('tts_program_dectalk', _('DECtalk program'), $text('tts_program_dectalk', $s['tts_program_dectalk']),
|
||||
_('For the live DECtalk voices (live-dectalk-*): DECtalk\'s say, run on this machine. Blank: dectalk on the PATH.'));
|
||||
$row('tts_program_sam', _('SAM program'), $text('tts_program_sam', $s['tts_program_sam']),
|
||||
_('For the live SAM voices (live-sam-*): the sam program, run on this machine. Blank: sam on the PATH.'));
|
||||
?>
|
||||
</form>
|
||||
@@ -121,6 +121,10 @@ ok(!isset($v['INDEX.md']), 'files are not voices');
|
||||
ok(!Clock::validateSettings(Clock::normalizeSettings(['voicedir' => '/x', 'default_voice' => 'a', 'timezone' => 'Europe/London', 'maxduration' => '0'])), 'good settings pass');
|
||||
$e = Clock::validateSettings(Clock::normalizeSettings(['voicedir' => 'rel', 'default_voice' => '../x', 'timezone' => 'Mars/Base', 'maxduration' => '-1']));
|
||||
ok(isset($e['voicedir'], $e['default_voice'], $e['timezone'], $e['maxduration']), 'bad settings caught');
|
||||
$e = Clock::validateSettings(Clock::normalizeSettings(['voicedir' => '/x', 'default_voice' => 'a', 'tts_program_sam' => 'sam; rm -rf /']));
|
||||
ok(isset($e['tts_program_sam']), 'bad tts_program caught');
|
||||
$t = Clock::normalizeSettings(['voicedir' => '/x', 'default_voice' => 'a', 'tts_program_dectalk' => '/opt/dectalk/say']);
|
||||
ok(!Clock::validateSettings($t) && strpos(Clock::renderConf($t), "tts_program_dectalk=/opt/dectalk/say\n") !== false, 'dectalk program written');
|
||||
|
||||
/* clock checks */
|
||||
$good = Clock::normalizeClock(['name' => 'tim', 'voice' => 'tim-pat-simmons', 'number' => '123',
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# make build mssam
|
||||
# make voices fetch the Microsoft Sam, Mike and Mary voice data (an 8 MB download)
|
||||
# make install install the program and the voices
|
||||
# make test speak a sentence with every voice
|
||||
PREFIX ?= /usr/local
|
||||
VOICEDIR ?= $(PREFIX)/share/mssam
|
||||
CC ?= cc
|
||||
CFLAGS ?= -O2 -Wall -Wextra
|
||||
SOURCES ?= ../../sources/mssam
|
||||
|
||||
mssam: mssam.c lexicon.h
|
||||
$(CC) $(CFLAGS) -DVOICEDIR='"$(VOICEDIR)"' -o $@ mssam.c -lm
|
||||
|
||||
voices: $(SOURCES)/sam.inv
|
||||
|
||||
$(SOURCES)/sam.inv:
|
||||
python3 ../../tools/fetch-mssam.py $(SOURCES)
|
||||
|
||||
install: mssam voices
|
||||
install -d $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(VOICEDIR)
|
||||
install -m 755 mssam $(DESTDIR)$(PREFIX)/bin/mssam
|
||||
install -m 644 $(SOURCES)/*.inv $(SOURCES)/*.tree $(SOURCES)/*.tones $(DESTDIR)$(VOICEDIR)/
|
||||
if [ -f $(SOURCES)/cmudict.dict ]; then install -m 644 $(SOURCES)/cmudict.dict $(DESTDIR)$(VOICEDIR)/; fi
|
||||
|
||||
test: mssam voices
|
||||
@for v in sam mike mary mike-tel mary-tel; do \
|
||||
./mssam -d $(SOURCES) -v $$v -o /tmp/mssam-$$v.wav \
|
||||
"At the third stroke, it will be ten oh five and twenty seconds." && \
|
||||
echo "/tmp/mssam-$$v.wav"; \
|
||||
done
|
||||
|
||||
clean:
|
||||
rm -f mssam
|
||||
|
||||
.PHONY: voices install test clean
|
||||
@@ -0,0 +1,57 @@
|
||||
# mssam
|
||||
|
||||
Our own synthesiser for the Microsoft Sam, Mike and Mary voices (Microsoft
|
||||
Speech API 4, 1998). It reads the voices' data and speaks with it. No
|
||||
Microsoft code is used or run, and none of Microsoft's files are in this
|
||||
repository: `tools/fetch-mssam.py` downloads Microsoft's package at build
|
||||
time and keeps only the voice data.
|
||||
|
||||
```sh
|
||||
make # build mssam
|
||||
make voices # fetch the voice data into ../../sources/mssam (8 MB download, needs cabextract or 7z)
|
||||
make test # speak a sentence with each voice
|
||||
sudo make install # /usr/local/bin/mssam and /usr/local/share/mssam
|
||||
```
|
||||
|
||||
```
|
||||
mssam [-d DIR] [-v sam|mike|mary|mike-tel|mary-tel] [-r RATE] [-p PITCH] [-o OUT.wav] TEXT...
|
||||
```
|
||||
|
||||
`mike-tel` and `mary-tel` are Microsoft's 8 kHz voices made for phone
|
||||
lines. `-d` is the folder with the voice data (default `/usr/local/share/mssam`,
|
||||
or `$MSSAM_DIR`). `-r` and `-p` multiply the speed and pitch. Without `-o`
|
||||
the WAV (22050 Hz, or 8000 Hz for the telephone voices, 16-bit mono) goes to standard output.
|
||||
|
||||
## How it speaks
|
||||
|
||||
1. The text becomes words (numbers and times like `11:05` are spelled out,
|
||||
`a.m.` is two letters), and the words become sounds from the CMU
|
||||
Pronouncing Dictionary: the clock's own words are built in
|
||||
(`lexicon.h`), and `cmudict.dict` in the voice folder covers the rest.
|
||||
Unknown words are spelled.
|
||||
2. Each sound gets one of the voice's recorded units. The voice has a
|
||||
decision tree for each sound, whose questions are about the sounds
|
||||
either side and where the sound is in its word; the leaf it reaches is
|
||||
the unit.
|
||||
3. Each unit is a run of frames: a 20th-order spectrum (line spectral
|
||||
frequencies) and a gain, with a pitch pulse for voiced frames and noise
|
||||
for the others. The frames are played through the filter at a new pace
|
||||
and with a new pitch. Each phrase starts near 100 Hz, the first stressed
|
||||
word rises above it, and the phrase sinks to about 73 Hz at the end of a sentence (before a
|
||||
comma it falls only a little, a sentence's last word is not
|
||||
stressed, and its stressed last vowel is held a little longer),
|
||||
the shape measured from Sam's own recordings (Mike and Mary are scaled
|
||||
to their own pitch, from their tone tables). The spectrum glides from
|
||||
frame to frame, the loudness of a unit's first frames leans toward the
|
||||
unit before it, each pitch pulse is blended with the one before below
|
||||
2 kHz (the stored pulses are rougher than Sam's speech), the gap between loud
|
||||
vowels and quiet consonants is narrowed a little, and a treble lift
|
||||
restores the brightness of the original recordings. Sam also gets a
|
||||
tone correction, because his vowels come out with less of the
|
||||
2.5-4 kHz range than his own voice, louder and shorter hiss sounds (s, f, th), each frame's stored
|
||||
loudness taken as the sound's own (so an "m" no longer drowns its
|
||||
vowel), and a formant postfilter (as speech codecs use) that
|
||||
clears the haze between his formants. When a phrase pauses, the filter
|
||||
rings out instead of stopping dead.
|
||||
|
||||
docs/mssam-format.md describes the voice data.
|
||||
@@ -0,0 +1,221 @@
|
||||
/* Pronunciations for the words a speaking clock says, so that synth/mssam
|
||||
* works without a dictionary file. Taken from the CMU Pronouncing
|
||||
* Dictionary (cmudict.dict), whose licence follows:
|
||||
*
|
||||
* Copyright (C) 1993-2015 Carnegie Mellon University. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* The contents of this file are deemed to be source code.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
|
||||
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
|
||||
* NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* sorted by word, for bsearch */
|
||||
static const struct { const char *word, *phones; } lexicon[] = {
|
||||
{"a", "AH0"},
|
||||
{"accurate", "AE1 K Y ER0 AH0 T"},
|
||||
{"after", "AE1 F T ER0"},
|
||||
{"afternoon", "AE2 F T ER0 N UW1 N"},
|
||||
{"am", "AE1 M"},
|
||||
{"an", "AE1 N"},
|
||||
{"and", "AH0 N D"},
|
||||
{"april", "EY1 P R AH0 L"},
|
||||
{"at", "AE1 T"},
|
||||
{"august", "AA1 G AH0 S T"},
|
||||
{"b", "B IY1"},
|
||||
{"be", "B IY1"},
|
||||
{"beep", "B IY1 P"},
|
||||
{"by", "B AY1"},
|
||||
{"c", "S IY1"},
|
||||
{"calling", "K AO1 L IH0 NG"},
|
||||
{"clock", "K L AA1 K"},
|
||||
{"computer", "K AH0 M P Y UW1 T ER0"},
|
||||
{"coordinated", "K OW0 AO1 R D AH0 N EY0 T IH0 D"},
|
||||
{"d", "D IY1"},
|
||||
{"daylight", "D EY1 L AY2 T"},
|
||||
{"december", "D IH0 S EH1 M B ER0"},
|
||||
{"e", "IY1"},
|
||||
{"eight", "EY1 T"},
|
||||
{"eighteen", "EY0 T IY1 N"},
|
||||
{"eighteenth", "EY0 T IY1 N TH"},
|
||||
{"eighth", "EY1 T TH"},
|
||||
{"eighty", "EY1 T IY0"},
|
||||
{"eleven", "IH0 L EH1 V AH0 N"},
|
||||
{"eleventh", "IH0 L EH1 V AH0 N TH"},
|
||||
{"evening", "IY1 V N IH0 NG"},
|
||||
{"exactly", "IH0 G Z AE1 K T L IY0"},
|
||||
{"f", "EH1 F"},
|
||||
{"february", "F EH1 B Y AH0 W EH2 R IY0"},
|
||||
{"fifteen", "F IH0 F T IY1 N"},
|
||||
{"fifteenth", "F IH0 F T IY1 N TH"},
|
||||
{"fifth", "F IH1 F TH"},
|
||||
{"fifty", "F IH1 F T IY0"},
|
||||
{"first", "F ER1 S T"},
|
||||
{"five", "F AY1 V"},
|
||||
{"for", "F AO1 R"},
|
||||
{"forty", "F AO1 R T IY0"},
|
||||
{"four", "F AO1 R"},
|
||||
{"fourteen", "F AO1 R T IY1 N"},
|
||||
{"fourteenth", "F AO1 R T IY1 N TH"},
|
||||
{"fourth", "F AO1 R TH"},
|
||||
{"friday", "F R AY1 D IY0"},
|
||||
{"g", "JH IY1"},
|
||||
{"good", "G UH1 D"},
|
||||
{"greenwich", "G R EH1 N IH0 CH"},
|
||||
{"h", "EY1 CH"},
|
||||
{"half", "HH AE1 F"},
|
||||
{"hear", "HH IY1 R"},
|
||||
{"hello", "HH AH0 L OW1"},
|
||||
{"here", "HH IY1 R"},
|
||||
{"hour", "AW1 ER0"},
|
||||
{"hours", "AW1 ER0 Z"},
|
||||
{"how", "HH AW1"},
|
||||
{"hundred", "HH AH1 N D R AH0 D"},
|
||||
{"i", "AY1"},
|
||||
{"is", "IH1 Z"},
|
||||
{"it", "IH1 T"},
|
||||
{"it's", "IH1 T S"},
|
||||
{"its", "IH1 T S"},
|
||||
{"j", "JH EY1"},
|
||||
{"january", "JH AE1 N Y UW0 EH2 R IY0"},
|
||||
{"july", "JH UW2 L AY1"},
|
||||
{"june", "JH UW1 N"},
|
||||
{"k", "K EY1"},
|
||||
{"l", "EH1 L"},
|
||||
{"local", "L OW1 K AH0 L"},
|
||||
{"m", "EH1 M"},
|
||||
{"march", "M AA1 R CH"},
|
||||
{"mary", "M EH1 R IY0"},
|
||||
{"may", "M EY1"},
|
||||
{"me", "M IY1"},
|
||||
{"mean", "M IY1 N"},
|
||||
{"microsoft", "M AY1 K R OW2 S AO1 F T"},
|
||||
{"midnight", "M IH1 D N AY2 T"},
|
||||
{"mike", "M AY1 K"},
|
||||
{"million", "M IH1 L Y AH0 N"},
|
||||
{"minute", "M IH1 N AH0 T"},
|
||||
{"minutes", "M IH1 N AH0 T S"},
|
||||
{"monday", "M AH1 N D IY0"},
|
||||
{"morning", "M AO1 R N IH0 NG"},
|
||||
{"my", "M AY1"},
|
||||
{"n", "EH1 N"},
|
||||
{"name", "N EY1 M"},
|
||||
{"next", "N EH1 K S T"},
|
||||
{"night", "N AY1 T"},
|
||||
{"nine", "N AY1 N"},
|
||||
{"nineteen", "N AY1 N T IY1 N"},
|
||||
{"nineteenth", "N AY1 N T IY1 N TH"},
|
||||
{"ninety", "N AY1 N T IY0"},
|
||||
{"ninth", "N AY1 N TH"},
|
||||
{"no", "N OW1"},
|
||||
{"noon", "N UW1 N"},
|
||||
{"not", "N AA1 T"},
|
||||
{"november", "N OW0 V EH1 M B ER0"},
|
||||
{"now", "N AW1"},
|
||||
{"o", "OW1"},
|
||||
{"o'clock", "AH0 K L AA1 K"},
|
||||
{"october", "AA0 K T OW1 B ER0"},
|
||||
{"of", "AH1 V"},
|
||||
{"oh", "OW1"},
|
||||
{"on", "AA1 N"},
|
||||
{"one", "W AH1 N"},
|
||||
{"p", "P IY1"},
|
||||
{"past", "P AE1 S T"},
|
||||
{"please", "P L IY1 Z"},
|
||||
{"pm", "P IY1 EH1 M"},
|
||||
{"precisely", "P R IH0 S AY1 S L IY0"},
|
||||
{"q", "K Y UW1"},
|
||||
{"quarter", "K W AO1 R T ER0"},
|
||||
{"r", "AA1 R"},
|
||||
{"s", "EH1 S"},
|
||||
{"sam", "S AE1 M"},
|
||||
{"saturday", "S AE1 T ER0 D IY0"},
|
||||
{"second", "S EH1 K AH0 N D"},
|
||||
{"seconds", "S EH1 K AH0 N D Z"},
|
||||
{"september", "S EH0 P T EH1 M B ER0"},
|
||||
{"seven", "S EH1 V AH0 N"},
|
||||
{"seventeen", "S EH1 V AH0 N T IY1 N"},
|
||||
{"seventeenth", "S EH1 V AH0 N T IY1 N TH"},
|
||||
{"seventh", "S EH1 V AH0 N TH"},
|
||||
{"seventy", "S EH1 V AH0 N T IY0"},
|
||||
{"signal", "S IH1 G N AH0 L"},
|
||||
{"six", "S IH1 K S"},
|
||||
{"sixteen", "S IH0 K S T IY1 N"},
|
||||
{"sixteenth", "S IH0 K S T IY1 N TH"},
|
||||
{"sixth", "S IH1 K S TH"},
|
||||
{"sixty", "S IH1 K S T IY0"},
|
||||
{"speaking", "S P IY1 K IH0 NG"},
|
||||
{"speech", "S P IY1 CH"},
|
||||
{"sponsored", "S P AA1 N S ER0 D"},
|
||||
{"standard", "S T AE1 N D ER0 D"},
|
||||
{"stroke", "S T R OW1 K"},
|
||||
{"sunday", "S AH1 N D EY2"},
|
||||
{"t", "T IY1"},
|
||||
{"talking", "T AO1 K IH0 NG"},
|
||||
{"ten", "T EH1 N"},
|
||||
{"tenth", "T EH1 N TH"},
|
||||
{"thank", "TH AE1 NG K"},
|
||||
{"thanks", "TH AE1 NG K S"},
|
||||
{"the", "DH AH0"},
|
||||
{"there", "DH EH1 R"},
|
||||
{"third", "TH ER1 D"},
|
||||
{"thirteen", "TH ER1 T IY1 N"},
|
||||
{"thirteenth", "TH ER1 T IY1 N TH"},
|
||||
{"thirtieth", "TH ER1 T IY0 AH0 TH"},
|
||||
{"thirty", "TH ER1 D IY2"},
|
||||
{"this", "DH IH1 S"},
|
||||
{"thousand", "TH AW1 Z AH0 N D"},
|
||||
{"three", "TH R IY1"},
|
||||
{"thursday", "TH ER1 Z D EY2"},
|
||||
{"time", "T AY1 M"},
|
||||
{"to", "T UW1"},
|
||||
{"today", "T AH0 D EY1"},
|
||||
{"tomorrow", "T AH0 M AA1 R OW2"},
|
||||
{"tone", "T OW1 N"},
|
||||
{"tuesday", "T UW1 Z D IY0"},
|
||||
{"twelfth", "T W EH1 L F TH"},
|
||||
{"twelve", "T W EH1 L V"},
|
||||
{"twentieth", "T W EH1 N T IY0 AH0 TH"},
|
||||
{"twenty", "T W EH1 N T IY0"},
|
||||
{"two", "T UW1"},
|
||||
{"u", "Y UW1"},
|
||||
{"universal", "Y UW2 N AH0 V ER1 S AH0 L"},
|
||||
{"v", "V IY1"},
|
||||
{"voice", "V OY1 S"},
|
||||
{"w", "D AH1 B AH0 L Y UW0"},
|
||||
{"wednesday", "W EH1 N Z D IY0"},
|
||||
{"welcome", "W EH1 L K AH0 M"},
|
||||
{"what", "W AH1 T"},
|
||||
{"when", "W EH1 N"},
|
||||
{"where", "W EH1 R"},
|
||||
{"who", "HH UW1"},
|
||||
{"why", "W AY1"},
|
||||
{"will", "W IH1 L"},
|
||||
{"x", "EH1 K S"},
|
||||
{"y", "W AY1"},
|
||||
{"yes", "Y EH1 S"},
|
||||
{"you", "Y UW1"},
|
||||
{"z", "Z IY1"},
|
||||
{"zero", "Z IH1 R OW0"},
|
||||
{"zulu", "Z UW1 L UW2"},
|
||||
};
|
||||
+1235
File diff suppressed because it is too large.
Load diff
+21
-1
@@ -7,6 +7,10 @@
|
||||
- Every voice renders a minute of sound at a few times of day without
|
||||
crashing Asterisk, and isn't silent.
|
||||
|
||||
- With TTS_VOICE=<a live voice>, that voice speaks (needs its
|
||||
synthesiser, tts_program_* in speakingclock.conf) and its made-up third pip
|
||||
lands on the second. Live voices are left out otherwise.
|
||||
|
||||
Run as a user that may use `asterisk -rx`, with the module loaded and the
|
||||
voices installed: test/render_test.py
|
||||
"""
|
||||
@@ -46,7 +50,8 @@ def render(voice, start, seconds, zone="UTC"):
|
||||
return struct.unpack("<%dh" % (len(d) // 2), d)
|
||||
|
||||
|
||||
voices = [l.split()[0] for l in cli("speakingclock show voices").splitlines()[1:] if l.strip()]
|
||||
rows = [l.split() for l in cli("speakingclock show voices").splitlines()[1:] if l.strip()]
|
||||
voices = [r[0] for r in rows if r[1] != "tts"]
|
||||
ok(len(voices) >= 80, "voices listed: %d" % len(voices))
|
||||
|
||||
# the time marks: start 5 s before 16:15:00 UTC, look at three cycles.
|
||||
@@ -96,6 +101,21 @@ for v in voices:
|
||||
ok(False, "%s at %d: %s" % (v, t, e))
|
||||
continue
|
||||
ok(max(abs(x) for x in a) > 1000, "%s at %d: silent" % (v, t))
|
||||
|
||||
# a live voice: speech before the pips, and the third made-up pip (1 kHz)
|
||||
# exactly on the second
|
||||
tts = os.environ.get("TTS_VOICE")
|
||||
if tts:
|
||||
a = render(tts, T, 32)
|
||||
tone = [int(8000 * __import__("math").sin(2 * 3.141592653589793 * 1000 * i / RATE)) for i in range(80)]
|
||||
raw = struct.pack("<%dh" % len(a), *a)
|
||||
marks = []
|
||||
for k in range(len(a) // (10 * RATE) + 1):
|
||||
second = (k + 1) * 10 * RATE - (T * RATE) % (10 * RATE) # samples to each :x0
|
||||
if second + 80 <= len(a):
|
||||
marks.append(list(a[second:second + 80]) == tone)
|
||||
ok(marks and all(marks), "%s: third pip on the second %s" % (tts, marks))
|
||||
ok(max(abs(x) for x in a[:3 * RATE]) > 1000, "%s: no speech" % tts)
|
||||
ok("Asterisk" in cli("core show version"), "Asterisk still up")
|
||||
|
||||
print("%s" % ("all passed" if not failed else "%d failed" % failed))
|
||||
|
||||
+12
-10
@@ -282,19 +282,21 @@ def build_tim(src, out):
|
||||
|
||||
def main():
|
||||
src, out = sys.argv[1], sys.argv[2]
|
||||
if os.path.exists(out):
|
||||
shutil.rmtree(out)
|
||||
os.makedirs(out)
|
||||
os.makedirs(out, exist_ok=True)
|
||||
# start again from nothing, but keep the synthesised voices
|
||||
# (tools/synth_voices.py), whose voice.conf names an engine
|
||||
for d in os.listdir(out):
|
||||
conf = os.path.join(out, d, "voice.conf")
|
||||
if os.path.isdir(os.path.join(out, d)) and \
|
||||
"\nengine=" not in (open(conf).read() if os.path.exists(conf) else ""):
|
||||
shutil.rmtree(os.path.join(out, d))
|
||||
build_tim(src, out)
|
||||
build_garry(src, out)
|
||||
build_steve(src, out)
|
||||
with open(os.path.join(out, "INDEX.md"), "w") as f:
|
||||
f.write("# Voices\n\nMade by tools/build_voices.py. Every recording "
|
||||
"belongs to its original owner (../NOTICE.md).\n\n")
|
||||
f.write("| id | name | mode | from |\n|---|---|---|---|\n")
|
||||
for v in sorted(voices):
|
||||
f.write("| `%s` | %s | %s | %s |\n" % v)
|
||||
print("%d voices" % len(voices))
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
from voice_index import write_index
|
||||
write_index(out)
|
||||
print("%d voices built" % len(voices))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
#!/usr/bin/env python3
|
||||
"""SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
Fetch the Microsoft Sam, Mike and Mary voice data (and Mike and Mary for
|
||||
telephone) for synth/mssam at build time.
|
||||
|
||||
Microsoft's files are not in this repository. This script downloads the
|
||||
Microsoft Speech API 4 text-to-speech package (msttsl.exe) from the
|
||||
Internet Archive, checks its SHA-256, unpacks its cabinet with cabextract
|
||||
or 7z, reads each voice file (an OLE compound file) and writes the parts
|
||||
synth/mssam uses as plain files:
|
||||
|
||||
OUT/<voice>.inv the voice's recorded sound units, as stored
|
||||
OUT/<voice>.tree the trees that pick a unit for each sound in its
|
||||
context, rewritten in our own simple layout
|
||||
OUT/<voice>.tones the voice's pitch table (plain text)
|
||||
OUT/cmudict.dict the CMU Pronouncing Dictionary, so that words a
|
||||
clock does not usually say can be spoken too
|
||||
(optional: synth/mssam knows the clock's words)
|
||||
|
||||
The voices are sam, mike, mary, mike-tel and mary-tel (the files sam.vce,
|
||||
male.vce, female.vce, and the 8 kHz telephone voices male8.vce and
|
||||
female8.vce). The layouts are described in docs/mssam-format.md.
|
||||
|
||||
Only data is read. Nothing from the package is run, and Microsoft's
|
||||
programs in it (msttssyn.dll and the rest) are not kept.
|
||||
|
||||
Usage: tools/fetch-mssam.py [OUT] (default: sources/mssam)
|
||||
tools/fetch-mssam.py --exe msttsl.exe [OUT]
|
||||
|
||||
Needs Python 3 and cabextract or 7z.
|
||||
"""
|
||||
import hashlib
|
||||
import os
|
||||
import shutil
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import urllib.request
|
||||
|
||||
URL = "https://archive.org/download/msttsl/msttsl.exe"
|
||||
SHA1 = "d988cbb3e99bc9dd850defda939c06b81d9d4544"
|
||||
CMUDICT = "https://raw.githubusercontent.com/cmusphinx/cmudict/master/cmudict.dict"
|
||||
VOICES = {"sam": "sam.vce", "mike": "male.vce", "mary": "female.vce",
|
||||
"mike-tel": "male8.vce", "mary-tel": "female8.vce"}
|
||||
POSITIONS = 4 # word positions: begins, ends, single, inside
|
||||
|
||||
|
||||
class Compound:
|
||||
"""Just enough of an OLE compound file reader to get streams out."""
|
||||
|
||||
def __init__(self, data):
|
||||
if data[:8] != bytes.fromhex("d0cf11e0a1b11ae1"):
|
||||
raise ValueError("not an OLE compound file")
|
||||
self.d = data
|
||||
self.ss = 1 << struct.unpack("<H", data[30:32])[0]
|
||||
self.mss = 1 << struct.unpack("<H", data[32:34])[0]
|
||||
nfat, dir0 = struct.unpack("<II", data[44:52])
|
||||
self.cutoff, mfat0, nmfat, difat0, ndifat = struct.unpack("<5I", data[56:76])
|
||||
difat = list(struct.unpack("<109I", data[76:512]))
|
||||
s = difat0
|
||||
for _ in range(ndifat):
|
||||
v = struct.unpack("<%dI" % (self.ss // 4), self.sector(s))
|
||||
difat += v[:-1]
|
||||
s = v[-1]
|
||||
self.fat = []
|
||||
for s in difat[:nfat]:
|
||||
self.fat += struct.unpack("<%dI" % (self.ss // 4), self.sector(s))
|
||||
self.minifat = []
|
||||
if nmfat:
|
||||
m = self.chain(mfat0)
|
||||
self.minifat = list(struct.unpack("<%dI" % (len(m) // 4), m))
|
||||
dirs = self.chain(dir0)
|
||||
self.entries = {}
|
||||
for i in range(0, len(dirs), 128):
|
||||
e = dirs[i:i + 128]
|
||||
nlen = struct.unpack("<H", e[64:66])[0]
|
||||
if nlen < 2:
|
||||
continue
|
||||
name = e[:nlen - 2].decode("utf-16-le")
|
||||
start, size = struct.unpack("<II", e[116:124])
|
||||
self.entries[name] = (e[66], start, size)
|
||||
if e[66] == 5:
|
||||
self.ministream = self.chain(start)[:size]
|
||||
|
||||
def sector(self, s):
|
||||
o = (s + 1) * self.ss
|
||||
return self.d[o:o + self.ss]
|
||||
|
||||
def chain(self, s):
|
||||
out = []
|
||||
while s < 0xFFFFFFFA:
|
||||
out.append(self.sector(s))
|
||||
s = self.fat[s]
|
||||
return b"".join(out)
|
||||
|
||||
def stream(self, name):
|
||||
typ, start, size = self.entries[name]
|
||||
if size >= self.cutoff:
|
||||
return self.chain(start)[:size]
|
||||
out = []
|
||||
s = start
|
||||
while s < 0xFFFFFFFA:
|
||||
out.append(self.ministream[s * self.mss:(s + 1) * self.mss])
|
||||
s = self.minifat[s]
|
||||
return b"".join(out)[:size]
|
||||
|
||||
|
||||
def rotate(m):
|
||||
"""The voice stores a set of sounds as a 64-bit mask with sound i at bit
|
||||
(i + 36) mod 64 and the four word positions at bits 32-35. Ours has
|
||||
sound i at bit i and the word positions at bits 60-63."""
|
||||
return ((m >> 36) | (m << 28)) & 0xFFFFFFFFFFFFFFFF
|
||||
|
||||
|
||||
def u32(d, o):
|
||||
return struct.unpack(">I", d[o:o + 4])[0]
|
||||
|
||||
|
||||
def u16(d, o):
|
||||
return struct.unpack(">H", d[o:o + 2])[0]
|
||||
|
||||
|
||||
def parse_trees(d, o, count):
|
||||
"""count trees of nodes; returns [(leaves, nodes)] and the end offset.
|
||||
Node: yes, no, 0xffff, then the indices of its questions, 0xffff.
|
||||
Leaf: 0xffff, n, n."""
|
||||
out = []
|
||||
for _ in range(count):
|
||||
nn, nl = u16(d, o), u16(d, o + 2)
|
||||
o += 4
|
||||
if nn != max(2 * nl - 1, 0):
|
||||
raise ValueError("tree header")
|
||||
nodes = []
|
||||
for _ in range(nn):
|
||||
x = u16(d, o)
|
||||
if x == 0xFFFF:
|
||||
a, b = u16(d, o + 2), u16(d, o + 4)
|
||||
o += 6
|
||||
if a != b or a >= nl:
|
||||
raise ValueError("leaf")
|
||||
nodes.append((-1, a, []))
|
||||
else:
|
||||
y = u16(d, o + 2)
|
||||
if u16(d, o + 4) != 0xFFFF or x >= nn or y >= nn:
|
||||
raise ValueError("node")
|
||||
o += 6
|
||||
q = []
|
||||
while u16(d, o) != 0xFFFF:
|
||||
q.append(u16(d, o))
|
||||
o += 2
|
||||
o += 2
|
||||
nodes.append((x, y, q))
|
||||
out.append((nl, nodes))
|
||||
return out, o
|
||||
|
||||
|
||||
def convert_tree(tree, phonefile):
|
||||
phones = [l.split()[0] for l in phonefile.decode("latin-1").splitlines() if l.strip()]
|
||||
n = len(phones)
|
||||
o = tree.index(b"tree\0") + 5
|
||||
if u32(tree, o) != n:
|
||||
raise ValueError("phone count")
|
||||
o += 4 + n # one byte per sound: its number of states (always 1)
|
||||
o += 4 + 4 * n # sound count again, then where each sound's senones end
|
||||
total = u32(tree, o)
|
||||
# then: total, 0, 18, 0xffffffff, the number of questions
|
||||
o += 4
|
||||
while u32(tree, o) != 0xFFFFFFFF:
|
||||
o += 4
|
||||
nq = u32(tree, o + 4)
|
||||
o += 8
|
||||
questions = [struct.unpack(">QQ", tree[o + 16 * i:o + 16 * i + 16]) for i in range(nq)]
|
||||
o += 16 * nq + 8
|
||||
trees, end = parse_trees(tree, o, n)
|
||||
if end != len(tree) or sum(t[0] for t in trees) != total:
|
||||
raise ValueError("trees do not add up")
|
||||
|
||||
out = [b"MSSAMTR1", struct.pack("<4I", n, nq, total, 1)]
|
||||
for left, right in questions:
|
||||
out.append(struct.pack("<QQ", rotate(left), rotate(right)))
|
||||
first = 0
|
||||
nodes = []
|
||||
qlist = []
|
||||
for name, (nl, tn) in zip(phones, trees):
|
||||
out.append(struct.pack("<8sIII", name.encode()[:8], first, len(tn), len(nodes)))
|
||||
for yes, no, q in tn:
|
||||
nodes.append(struct.pack("<iiII", yes, no, len(qlist), len(q)))
|
||||
qlist += q
|
||||
first += nl
|
||||
out.append(struct.pack("<II", len(nodes), len(qlist)))
|
||||
out += nodes
|
||||
out.append(struct.pack("<%dH" % len(qlist), *qlist))
|
||||
return b"".join(out)
|
||||
|
||||
|
||||
def unpack(exe, tmp):
|
||||
for cmd in (["cabextract", "-q", "-d", tmp, exe], ["7z", "x", "-y", "-o" + tmp, exe]):
|
||||
if shutil.which(cmd[0]):
|
||||
subprocess.run(cmd, check=True, stdout=subprocess.DEVNULL)
|
||||
return
|
||||
sys.exit("fetch-mssam: needs cabextract or 7z to unpack msttsl.exe")
|
||||
|
||||
|
||||
def main():
|
||||
args = sys.argv[1:]
|
||||
exe = None
|
||||
if args[:1] == ["--exe"]:
|
||||
exe, args = args[1], args[2:]
|
||||
out = args[0] if args else "sources/mssam"
|
||||
os.makedirs(out, exist_ok=True)
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
if not exe:
|
||||
exe = os.path.join(tmp, "msttsl.exe")
|
||||
print("fetch-mssam: downloading", URL)
|
||||
urllib.request.urlretrieve(URL, exe)
|
||||
if hashlib.sha1(open(exe, "rb").read()).hexdigest() != SHA1:
|
||||
sys.exit("fetch-mssam: msttsl.exe does not match the expected checksum")
|
||||
unpack(exe, tmp)
|
||||
files = {f.lower(): os.path.join(tmp, f) for f in os.listdir(tmp)}
|
||||
for voice, vce in VOICES.items():
|
||||
c = Compound(open(files[vce], "rb").read())
|
||||
with open(os.path.join(out, voice + ".inv"), "wb") as f:
|
||||
f.write(c.stream("Inventory"))
|
||||
with open(os.path.join(out, voice + ".tree"), "wb") as f:
|
||||
f.write(convert_tree(c.stream("TreeImage"), c.stream("PhoneFile")))
|
||||
with open(os.path.join(out, voice + ".tones"), "wb") as f:
|
||||
f.write(c.stream("Cdb"))
|
||||
print("fetch-mssam: wrote", voice)
|
||||
dic = os.path.join(out, "cmudict.dict")
|
||||
if not os.path.exists(dic):
|
||||
try:
|
||||
urllib.request.urlretrieve(CMUDICT, dic + ".tmp")
|
||||
os.replace(dic + ".tmp", dic)
|
||||
print("fetch-mssam: wrote cmudict.dict")
|
||||
except OSError as e:
|
||||
print("fetch-mssam: no cmudict.dict (%s); only the clock's own words will be known" % e)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Executable
+327
@@ -0,0 +1,327 @@
|
||||
#!/usr/bin/env python3
|
||||
"""SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
Make clock voices from speech synthesisers: every clip a clock needs is
|
||||
spoken by the synthesiser on its own (a whole phrase or number, not glued
|
||||
syllables), trimmed, converted to 8 kHz 16-bit mono WAV, and written as a
|
||||
voice folder with a voice.conf (docs/voice-format.md).
|
||||
|
||||
Usage: tools/synth_voices.py OUT VOICE... (OUT is normally ./voices)
|
||||
tools/synth_voices.py --live OUT VOICE...
|
||||
tools/synth_voices.py --list
|
||||
|
||||
--live writes a live voice instead (mode=tts, live-<engine>-<voice>): no
|
||||
clips, the module runs the synthesiser on the Asterisk machine for each
|
||||
sentence as it is needed (dectalk, sam and mssam only; tts_program_dectalk,
|
||||
tts_program_sam and tts_program_mssam in speakingclock.conf say where they
|
||||
are).
|
||||
|
||||
Engines (a VOICE is engine:name, see --list):
|
||||
sapi4 Microsoft Speech API 4 voices (Microsoft Sam, Mike, Mary,
|
||||
TruVoice, L&H), spoken by the public SAPI4 service at
|
||||
https://www.tetyys.com/SAPI4/ (a few hundred requests a voice,
|
||||
spaced out; downloads are cached in $SYNTH_CACHE).
|
||||
dectalk DECtalk 4.x, from https://github.com/dectalk/dectalk (develop
|
||||
branch). $DECTALK_SAY is its `say` program.
|
||||
sam Software Automatic Mouth (C64, 1982), the C port at
|
||||
https://github.com/s-macke/SAM. $SAM is its `sam` program.
|
||||
mssam Microsoft Sam, Mike and Mary, spoken by our own synthesiser
|
||||
(synth/mssam) from the voice data that tools/fetch-mssam.py
|
||||
fetches. $MSSAM is its `mssam` program.
|
||||
mac MacInTalk / PlainTalk voices, with macOS's own `say` (run this
|
||||
on a Mac).
|
||||
|
||||
Needs ffmpeg and sox.
|
||||
"""
|
||||
import hashlib
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
|
||||
ONES = ["zero", "one", "two", "three", "four", "five", "six", "seven",
|
||||
"eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen",
|
||||
"fifteen", "sixteen", "seventeen", "eighteen", "nineteen"]
|
||||
TENS = {20: "twenty", 30: "thirty", 40: "forty", 50: "fifty"}
|
||||
|
||||
|
||||
def words(n):
|
||||
if n < 20:
|
||||
return ONES[n]
|
||||
t, u = n // 10 * 10, n % 10
|
||||
return TENS[t] + ("-" + ONES[u] if u else "")
|
||||
|
||||
|
||||
def clips():
|
||||
"""clip name -> what to say"""
|
||||
c = {
|
||||
"phrase": "At the third stroke, it will be",
|
||||
"its": "The time is",
|
||||
"oclock": "o'clock",
|
||||
"oh": "oh",
|
||||
"precisely": "precisely.",
|
||||
"am": "A.M.",
|
||||
"pm": "P.M.",
|
||||
"noon": "twelve noon",
|
||||
"midnight": "midnight",
|
||||
"greet_morning": "Good morning.",
|
||||
"greet_afternoon": "Good afternoon.",
|
||||
"greet_evening": "Good evening.",
|
||||
}
|
||||
for n in range(0, 60):
|
||||
c["n%d" % n] = words(n)
|
||||
for m in range(1, 10):
|
||||
c["m%d" % m] = "oh " + ONES[m]
|
||||
for s in range(10, 60, 10):
|
||||
c["s%d" % s] = "and %s seconds." % words(s)
|
||||
return c
|
||||
|
||||
|
||||
# ---- engines: each speaks text into a WAV file -----------------------------
|
||||
|
||||
CACHE = os.environ.get("SYNTH_CACHE", os.path.join("sources", "synth-cache"))
|
||||
|
||||
SAPI4 = {
|
||||
# id: (service voice, pitch, speed, name, description)
|
||||
"microsoft-sam": ("Sam", 100, 150, "Microsoft Sam (SAPI4)",
|
||||
"Microsoft Speech API 4 voice, the voice of Windows 2000 and XP's Narrator"),
|
||||
"microsoft-mike": ("Mike", 113, 170, "Microsoft Mike (SAPI4)", "Microsoft Speech API 4 voice"),
|
||||
"microsoft-mary": ("Mary", 169, 170, "Microsoft Mary (SAPI4)", "Microsoft Speech API 4 voice"),
|
||||
"microsoft-mike-tel": ("Mike (for Telephone)", 113, 170, "Microsoft Mike for Telephone (SAPI4)",
|
||||
"Microsoft Speech API 4 voice tuned for telephone lines"),
|
||||
"bonzibuddy": ("Adult Male #2, American English (TruVoice)", 140, 157, "BonziBUDDY (SAPI4 TruVoice)",
|
||||
"Lernout & Hauspie TruVoice Adult Male #2 at BonziBUDDY's pitch and speed"),
|
||||
"truvoice-male1": ("Adult Male #1, American English (TruVoice)", 120, 140,
|
||||
"TruVoice Adult Male #1 (SAPI4)", "Lernout & Hauspie TruVoice"),
|
||||
"truvoice-female1": ("Adult Female #1, American English (TruVoice)", 290, 140,
|
||||
"TruVoice Adult Female #1 (SAPI4)", "Lernout & Hauspie TruVoice"),
|
||||
"robosoft-one": ("RoboSoft One", 100, 150, "RoboSoft One (SAPI4)", "SAPI4 novelty voice"),
|
||||
"lh-reed": ("English-American: Reed (Adult Male), 6.1", 100, 150, "L&H Reed (SAPI4)",
|
||||
"Lernout & Hauspie TTS3000 American English"),
|
||||
"lh-jane": ("English-British: Jane (Adult Female), 6.1", 100, 150, "L&H Jane (SAPI4)",
|
||||
"Lernout & Hauspie TTS3000 British English"),
|
||||
}
|
||||
|
||||
DECTALK = {
|
||||
# id: (voice code, name)
|
||||
"paul": ("np", "Perfect Paul"), "betty": ("nb", "Beautiful Betty"),
|
||||
"harry": ("nh", "Huge Harry"), "frank": ("nf", "Frail Frank"),
|
||||
"dennis": ("nd", "Doctor Dennis"), "kit": ("nk", "Kit the Kid"),
|
||||
"ursula": ("nu", "Uppity Ursula"), "rita": ("nr", "Rough Rita"),
|
||||
"wendy": ("nw", "Whispering Wendy"),
|
||||
}
|
||||
|
||||
SAM = {
|
||||
# id: (speed, pitch, mouth, throat, name) - the presets in SAM's manual
|
||||
"sam": (72, 64, 128, 128, "SAM"),
|
||||
"elf": (72, 64, 110, 160, "SAM Elf"),
|
||||
"little-robot": (92, 60, 190, 190, "SAM Little Robot"),
|
||||
"stuffy-guy": (82, 72, 110, 105, "SAM Stuffy Guy"),
|
||||
"little-old-lady": (82, 32, 145, 145, "SAM Little Old Lady"),
|
||||
"extra-terrestrial": (100, 64, 150, 200, "SAM Extra-Terrestrial"),
|
||||
}
|
||||
|
||||
# macOS's own say speaks them. The MacinTalk 3 voices (1993) and the
|
||||
# PlainTalk ones (MacinTalk Pro, 1994-95, the voices of System 7.5 to Mac
|
||||
# OS 9). Which ones a Mac still has depends on its macOS: say -v '?'.
|
||||
MAC_FAMILY = {
|
||||
"MacInTalk": ["Fred", "Ralph", "Junior", "Kathy", "Albert", "Bahh",
|
||||
"Bells", "Boing", "Bubbles", "Cellos", "Trinoids", "Whisper",
|
||||
"Zarvox", "Bad News", "Good News", "Wobble", "Jester", "Organ",
|
||||
"Superstar", "Princess"],
|
||||
"PlainTalk": ["Victoria", "Agnes", "Bruce", "Vicki"],
|
||||
}
|
||||
MAC = {v: f for f, vs in MAC_FAMILY.items() for v in vs}
|
||||
|
||||
last_request = [0.0]
|
||||
|
||||
|
||||
def sapi4(vid, text, out):
|
||||
voice, pitch, speed = SAPI4[vid][:3]
|
||||
url = "https://www.tetyys.com/SAPI4/SAPI4?" + urllib.parse.urlencode(
|
||||
{"text": text, "voice": voice, "pitch": pitch, "speed": speed})
|
||||
key = hashlib.sha1(url.encode()).hexdigest()
|
||||
cached = os.path.join(CACHE, "sapi4", key + ".wav")
|
||||
if not os.path.exists(cached):
|
||||
os.makedirs(os.path.dirname(cached), exist_ok=True)
|
||||
for attempt in range(4):
|
||||
wait = 0.5 - (time.time() - last_request[0])
|
||||
if wait > 0:
|
||||
time.sleep(wait)
|
||||
last_request[0] = time.time()
|
||||
try:
|
||||
req = urllib.request.Request(url, headers={"User-Agent": "speaking-clock voice builder"})
|
||||
with urllib.request.urlopen(req, timeout=60) as r:
|
||||
data = r.read()
|
||||
if data[:4] != b"RIFF":
|
||||
raise RuntimeError("not a WAV")
|
||||
with open(cached + ".part", "wb") as f:
|
||||
f.write(data)
|
||||
os.rename(cached + ".part", cached)
|
||||
break
|
||||
except Exception: # noqa: BLE001
|
||||
if attempt == 3:
|
||||
raise
|
||||
time.sleep(2 ** (attempt + 1))
|
||||
shutil.copy(cached, out)
|
||||
|
||||
|
||||
def dectalk(vid, text, out):
|
||||
say = os.environ.get("DECTALK_SAY", "say")
|
||||
code = DECTALK[vid][0]
|
||||
subprocess.run([say, "-fo", out, "-a", "[:%s] %s" % (code, text)], check=True,
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
|
||||
|
||||
def sam(vid, text, out):
|
||||
speed, pitch, mouth, throat = SAM[vid][:4]
|
||||
prog = os.environ.get("SAM", "sam")
|
||||
subprocess.run([prog, "-wav", out, "-speed", str(speed), "-pitch", str(pitch),
|
||||
"-mouth", str(mouth), "-throat", str(throat), text.replace("-", " ")],
|
||||
check=True, stdout=subprocess.DEVNULL)
|
||||
|
||||
|
||||
MSSAM = {
|
||||
"sam": ("Microsoft Sam", "Microsoft Speech API 4 voice Sam"),
|
||||
"mike": ("Microsoft Mike", "Microsoft Speech API 4 voice Mike"),
|
||||
"mary": ("Microsoft Mary", "Microsoft Speech API 4 voice Mary"),
|
||||
"mike-tel": ("Microsoft Mike for Telephone", "Microsoft Speech API 4 voice Mike, made for phone lines"),
|
||||
"mary-tel": ("Microsoft Mary for Telephone", "Microsoft Speech API 4 voice Mary, made for phone lines"),
|
||||
}
|
||||
|
||||
|
||||
def mssam(vid, text, out):
|
||||
prog = os.environ.get("MSSAM", "mssam")
|
||||
subprocess.run([prog, "-v", vid, "-o", out, text], check=True)
|
||||
|
||||
|
||||
def mac_check(vid):
|
||||
have = subprocess.run(["say", "-v", "?"], capture_output=True, text=True).stdout
|
||||
if not any(line.split(" ")[0].strip() == vid for line in have.splitlines()):
|
||||
sys.exit("this Mac has no voice %r (say -v '?' lists the ones it has)" % vid)
|
||||
|
||||
|
||||
def mac(vid, text, out):
|
||||
aiff = out + ".aiff"
|
||||
subprocess.run(["say", "-v", vid, "-o", aiff, text], check=True)
|
||||
subprocess.run(["ffmpeg", "-v", "error", "-y", "-i", aiff, out], check=True)
|
||||
os.unlink(aiff)
|
||||
|
||||
|
||||
ENGINES = {
|
||||
"sapi4": (sapi4, SAPI4, lambda v: (SAPI4[v][3], SAPI4[v][4]),
|
||||
"Microsoft Speech API 4 runtime and voices, spoken by https://www.tetyys.com/SAPI4/"),
|
||||
"dectalk": (dectalk, DECTALK, lambda v: ("DECtalk " + DECTALK[v][1], "DECtalk 4.x"),
|
||||
"DECtalk (Digital Equipment Corp.), https://github.com/dectalk/dectalk"),
|
||||
"sam": (sam, SAM, lambda v: (SAM[v][4], "Software Automatic Mouth (Commodore 64, 1982)"),
|
||||
"SAM, Don't Ask Software (now SoftVoice, Inc.), C port https://github.com/s-macke/SAM"),
|
||||
"mssam": (mssam, MSSAM, lambda v: (MSSAM[v][0], "%s, by our own synthesiser" % MSSAM[v][1]),
|
||||
"synth/mssam (this repository, clean-room) reading Microsoft's Speech API 4 voice data "
|
||||
"(msttsl.exe), fetched by tools/fetch-mssam.py"),
|
||||
"mac": (mac, MAC, lambda v: ("%s %s" % (MAC[v], v),
|
||||
"Apple PlainTalk (MacinTalk Pro) voice" if MAC[v] == "PlainTalk"
|
||||
else "Apple MacInTalk 3 voice"),
|
||||
"Apple MacInTalk / PlainTalk, spoken by macOS's say"),
|
||||
}
|
||||
|
||||
|
||||
def finish(raw, out):
|
||||
"""trim the silence around a clip, leave 40 ms each side, 8 kHz mono"""
|
||||
subprocess.run(["sox", raw, "-r", "8000", "-c", "1", "-b", "16", "-e", "signed-integer", out,
|
||||
"silence", "1", "0.01", "0.3%", "reverse", "silence", "1", "0.01", "0.3%", "reverse",
|
||||
"pad", "0.04", "0.04", "norm", "-3"], check=True)
|
||||
|
||||
|
||||
def build(out_dir, engine, vid):
|
||||
fn, table, info, source = ENGINES[engine]
|
||||
name, desc = info(vid)
|
||||
if engine == "mac":
|
||||
mac_check(vid)
|
||||
d = os.path.join(out_dir, "%s-%s" % (engine, vid.lower().replace(" ", "-")))
|
||||
if os.path.exists(d):
|
||||
shutil.rmtree(d)
|
||||
os.makedirs(d)
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
for clip, text in clips().items():
|
||||
raw = os.path.join(tmp, clip + ".raw.wav")
|
||||
fn(vid, text, raw)
|
||||
finish(raw, os.path.join(d, clip + ".wav"))
|
||||
with open(os.path.join(d, "voice.conf"), "w") as f:
|
||||
f.write("; Voice for app_speakingclock (docs/voice-format.md), made by\n"
|
||||
"; tools/synth_voices.py %s:%s. The synthesiser belongs to its owners;\n"
|
||||
"; see NOTICE.md.\n\n[voice]\nname=%s\ndescription=%s\nmode=tim\n"
|
||||
"sequence=phrase+hour+minute+seconds+pips\nperiod=10\n"
|
||||
"; no pips.wav: the module makes the pips (1 kHz, the third one marks the time)\n"
|
||||
"\n[source]\nengine=%s\nvoice=%s\nsynthesiser=%s\n" % (engine, vid, name, desc, engine, vid, source))
|
||||
print(d)
|
||||
|
||||
|
||||
def build_live(out_dir, engine, vid):
|
||||
table = ENGINES[engine][1]
|
||||
name, desc = ENGINES[engine][2](vid)
|
||||
if engine == "dectalk":
|
||||
how = 'command={program:dectalk} -fo {out} -a "[:%s] {text}"' % DECTALK[vid][0]
|
||||
by = "DECtalk's say, run here (tts_program_dectalk)"
|
||||
elif engine == "mssam":
|
||||
how = 'command={program:mssam} -v %s -o {out} "{text}"' % vid
|
||||
by = "synth/mssam, run here (tts_program_mssam)"
|
||||
else:
|
||||
speed, pitch, mouth, throat = SAM[vid][:4]
|
||||
how = ("command={program:sam} -wav {out} -speed %d -pitch %d -mouth %d -throat %d \"{text}\""
|
||||
% (speed, pitch, mouth, throat))
|
||||
by = "SAM, run here (tts_program_sam)"
|
||||
text = "At the third stroke, it will be {hour} {minute} {seconds}."
|
||||
d = os.path.join(out_dir, "live-%s-%s" % (engine, vid.lower().replace(" ", "-")))
|
||||
os.makedirs(d, exist_ok=True)
|
||||
with open(os.path.join(d, "voice.conf"), "w") as f:
|
||||
f.write("; Live voice for app_speakingclock (docs/voice-format.md), made by\n"
|
||||
"; tools/synth_voices.py --live %s:%s. Each sentence is spoken when\n"
|
||||
"; it is needed, by %s.\n"
|
||||
"%s\n\n"
|
||||
"[voice]\nname=%s, live\ndescription=%s, spoken live\n"
|
||||
"mode=tts\nsequence=speech+pips\nperiod=10\n\n[tts]\n%s\ntext=%s\n"
|
||||
"\n[source]\nengine=%s\nvoice=%s\nsynthesiser=%s\n"
|
||||
% (engine, vid, by,
|
||||
"; The synthesiser is ours; the voice data it reads is Microsoft's and is\n"
|
||||
"; not in this repository (tools/fetch-mssam.py downloads it); see NOTICE.md."
|
||||
if engine == "mssam" else "; The synthesiser belongs to its owners; see NOTICE.md.",
|
||||
name, desc, how, text, engine, vid, ENGINES[engine][3]))
|
||||
assert vid in table
|
||||
print(d)
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) > 2 and sys.argv[1] == "--live":
|
||||
for spec in sys.argv[3:]:
|
||||
engine, _, vid = spec.partition(":")
|
||||
if engine not in ("dectalk", "sam", "mssam") or vid not in ENGINES[engine][1]:
|
||||
sys.exit("--live takes dectalk, sam and mssam voices (see --list)")
|
||||
build_live(sys.argv[2], engine, vid)
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
from voice_index import write_index
|
||||
write_index(sys.argv[2])
|
||||
return
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "--list":
|
||||
for e, (_, table, info, _) in ENGINES.items():
|
||||
for v in table:
|
||||
print("%s:%s\t%s" % (e, v, info(v)[0]))
|
||||
return
|
||||
if len(sys.argv) < 3:
|
||||
sys.exit(__doc__)
|
||||
out = sys.argv[1]
|
||||
for spec in sys.argv[2:]:
|
||||
engine, _, vid = spec.partition(":")
|
||||
if engine not in ENGINES or vid not in ENGINES[engine][1]:
|
||||
sys.exit("unknown voice %s (see --list)" % spec)
|
||||
build(out, engine, vid)
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
from voice_index import write_index
|
||||
write_index(out)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python3
|
||||
"""SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
Write voices/INDEX.md from every voice folder's voice.conf.
|
||||
Usage: tools/voice_index.py [VOICES] (default ./voices)
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def read_conf(path):
|
||||
conf, section = {}, None
|
||||
for line in open(path, encoding="utf-8", errors="replace"):
|
||||
line = line.strip()
|
||||
if not line or line.startswith(";"):
|
||||
continue
|
||||
if line.startswith("["):
|
||||
section = line.strip("[]").lower()
|
||||
continue
|
||||
k, _, v = line.partition("=")
|
||||
conf.setdefault(section, {})[k.strip().lower()] = v.strip()
|
||||
return conf
|
||||
|
||||
|
||||
def write_index(out):
|
||||
rows = []
|
||||
for vid in sorted(os.listdir(out)):
|
||||
p = os.path.join(out, vid, "voice.conf")
|
||||
if not os.path.isfile(p):
|
||||
continue
|
||||
c = read_conf(p)
|
||||
v, s = c.get("voice", {}), c.get("source", {})
|
||||
origin = s.get("collection") or ("%s synthesiser" % s["engine"] if "engine" in s else "")
|
||||
rows.append((vid, v.get("name", vid).replace("|", "/"), v.get("mode", "talking"), origin))
|
||||
with open(os.path.join(out, "INDEX.md"), "w") as f:
|
||||
f.write("# Voices\n\nWritten by tools/voice_index.py. Every recording "
|
||||
"belongs to its original owner (../NOTICE.md).\n\n")
|
||||
f.write("| id | name | mode | from |\n|---|---|---|---|\n")
|
||||
for r in rows:
|
||||
f.write("| `%s` | %s | %s | %s |\n" % r)
|
||||
return len(rows)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("%d voices" % write_index(sys.argv[1] if len(sys.argv) > 1 else "voices"))
|
||||
+110
-80
@@ -1,87 +1,117 @@
|
||||
# Voices
|
||||
|
||||
Made by tools/build_voices.py. Every recording belongs to its original owner (../NOTICE.md).
|
||||
Written by tools/voice_index.py. Every recording belongs to its original owner (../NOTICE.md).
|
||||
|
||||
| id | name | mode | from |
|
||||
|---|---|---|---|
|
||||
| `actim-talking-clock` | Actim Talking Clock | talking | Steve's Talking Clock |
|
||||
| `annoying-clock` | Annoying Clock | chime | Steve's Talking Clock |
|
||||
| `apollo-clock` | Apollo Clock | talking | Steve's Talking Clock |
|
||||
| `atandt-audrey` | AT&T Audrey | talking | Steve's Talking Clock |
|
||||
| `atandt-charles` | AT&T Charles | talking | Steve's Talking Clock |
|
||||
| `atandt-lauren` | AT&T Lauren | talking | Steve's Talking Clock |
|
||||
| `atandt-mike` | AT&T Mike | talking | Steve's Talking Clock |
|
||||
| `atandt-ray` | AT&T Ray | talking | Steve's Talking Clock |
|
||||
| `atandt-rich` | AT&T Rich | talking | Steve's Talking Clock |
|
||||
| `att-anjali` | ATT Anjali | talking | Steve's Talking Clock |
|
||||
| `backwards-clock` | Backwards Clock | talking | Steve's Talking Clock |
|
||||
| `belching-clock` | Belching Clock | talking | Steve's Talking Clock |
|
||||
| `big-ben` | Big Ben | chime | Steve's Talking Clock |
|
||||
| `bong-clock` | Bong Clock | talking | Steve's Talking Clock |
|
||||
| `braille-lite` | Braille Lite | talking | Steve's Talking Clock |
|
||||
| `brit-watch` | Brit Watch | talking | Steve's Talking Clock |
|
||||
| `british-amy` | British Amy | talking | garrysblog |
|
||||
| `cepstral-duncan` | Cepstral Duncan | talking | Steve's Talking Clock |
|
||||
| `cepstral-lawrence` | Cepstral Lawrence | talking | Steve's Talking Clock |
|
||||
| `cobolt-talking-clock` | Cobolt Talking Clock | talking | Steve's Talking Clock |
|
||||
| `cristo-the-australian-clock` | Cristo the Australian Clock | talking | Steve's Talking Clock |
|
||||
| `derek-lanes-clock` | Derek Lane's Clock | talking | Steve's Talking Clock |
|
||||
| `docss-clock` | Doc'ss Clock | hourly | Steve's Talking Clock |
|
||||
| `doubletalk-clock` | Doubletalk Clock | talking | Steve's Talking Clock |
|
||||
| `echo-clock` | Echo Clock | talking | Steve's Talking Clock |
|
||||
| `eloquence-clock` | Eloquence Clock | talking | Steve's Talking Clock |
|
||||
| `fransisco-clock` | Fransisco Clock | talking | Steve's Talking Clock |
|
||||
| `french-celine` | French Celine | talking | garrysblog |
|
||||
| `goldfingas-clock` | GoldFingas Clock | talking | Steve's Talking Clock |
|
||||
| `hitachi` | Hitachi | talking | Steve's Talking Clock |
|
||||
| `irish-clock` | Irish Clock | talking | Steve's Talking Clock |
|
||||
| `james-bowdens-clock` | James Bowden's Clock | talking | Steve's Talking Clock |
|
||||
| `julies-clock` | Julie's Clock | talking | Steve's Talking Clock |
|
||||
| `kathleen-perdues-clock` | Kathleen Perdue's Clock | talking | Steve's Talking Clock |
|
||||
| `keaos-clock` | Keao's Clock | talking | Steve's Talking Clock |
|
||||
| `keynote-gold-clock` | Keynote Gold Clock | talking | Steve's Talking Clock |
|
||||
| `larger-than-life` | Larger Than Life | talking | Steve's Talking Clock |
|
||||
| `lucys-clock` | Lucy's Clock | talking | Steve's Talking Clock |
|
||||
| `maggies-clock` | Maggie's Clock | talking | Steve's Talking Clock |
|
||||
| `morse-code-clock` | Morse Code Clock | talking | Steve's Talking Clock |
|
||||
| `neospeech-paul` | Neospeech Paul | talking | Steve's Talking Clock |
|
||||
| `nfb-ttq` | NFB TTQ | talking | Steve's Talking Clock |
|
||||
| `nick-gs-clock` | Nick G's Clock | talking | Steve's Talking Clock |
|
||||
| `nokia-tts` | Nokia TTS | talking | Steve's Talking Clock |
|
||||
| `onjs-clock` | Onj's Clock | talking | Steve's Talking Clock |
|
||||
| `onjs-clock-ii` | Onj's Clock II | talking | Steve's Talking Clock |
|
||||
| `outspoken` | Outspoken | talking | Steve's Talking Clock |
|
||||
| `patrick-perdues-clock` | Patrick Perdue's Clock | talking | Steve's Talking Clock |
|
||||
| `pentatonic-windchimes` | Pentatonic Windchimes | chime | Steve's Talking Clock |
|
||||
| `piano-major` | Piano Major | talking | Steve's Talking Clock |
|
||||
| `piano-minor` | Piano Minor | talking | Steve's Talking Clock |
|
||||
| `rainee-perdues-clock` | Rainee Perdue's Clock | talking | Steve's Talking Clock |
|
||||
| `rc-systems-repeater` | RC Systems Repeater | talking | Steve's Talking Clock |
|
||||
| `retro-rsynth-clock` | Retro (rsynth) Clock | talking | Steve's Talking Clock |
|
||||
| `rnc-clock` | RNC Clock | chime | Steve's Talking Clock |
|
||||
| `satoki-talking-watch` | Satoki Talking Watch | talking | Steve's Talking Clock |
|
||||
| `scansoft-isabel` | Scansoft Isabel | talking | Steve's Talking Clock |
|
||||
| `scansoft-jane` | Scansoft Jane | talking | Steve's Talking Clock |
|
||||
| `scansoft-jennifer` | Scansoft Jennifer | talking | Steve's Talking Clock |
|
||||
| `scottish-clock` | Scottish Clock | talking | Steve's Talking Clock |
|
||||
| `sharp-el-640` | Sharp EL-640 | talking | Steve's Talking Clock |
|
||||
| `sharp-talking-time-i` | Sharp Talking Time I | talking | Steve's Talking Clock |
|
||||
| `shawn-cleins-clock` | Shawn Clein's Clock | talking | Steve's Talking Clock |
|
||||
| `smooth-talker` | Smooth Talker | talking | Steve's Talking Clock |
|
||||
| `steves-quacking-clock` | Steve's Quacking Clock | talking | Steve's Talking Clock |
|
||||
| `talkbox-clock` | TalkBox clock | talking | Steve's Talking Clock |
|
||||
| `tammy-cube-clock` | Tammy Cube Clock | talking | Steve's Talking Clock |
|
||||
| `actim-talking-clock` | Actim Talking Clock | talking | Steve's Talking Clock voice library |
|
||||
| `annoying-clock` | Annoying Clock | chime | Steve's Talking Clock voice library |
|
||||
| `apollo-clock` | Apollo Clock | talking | Steve's Talking Clock voice library |
|
||||
| `atandt-audrey` | AT&T Audrey | talking | Steve's Talking Clock voice library |
|
||||
| `atandt-charles` | AT&T Charles | talking | Steve's Talking Clock voice library |
|
||||
| `atandt-lauren` | AT&T Lauren | talking | Steve's Talking Clock voice library |
|
||||
| `atandt-mike` | AT&T Mike | talking | Steve's Talking Clock voice library |
|
||||
| `atandt-ray` | AT&T Ray | talking | Steve's Talking Clock voice library |
|
||||
| `atandt-rich` | AT&T Rich | talking | Steve's Talking Clock voice library |
|
||||
| `att-anjali` | ATT Anjali | talking | Steve's Talking Clock voice library |
|
||||
| `backwards-clock` | Backwards Clock | talking | Steve's Talking Clock voice library |
|
||||
| `belching-clock` | Belching Clock | talking | Steve's Talking Clock voice library |
|
||||
| `big-ben` | Big Ben | chime | Steve's Talking Clock voice library |
|
||||
| `bong-clock` | Bong Clock | talking | Steve's Talking Clock voice library |
|
||||
| `braille-lite` | Braille Lite | talking | Steve's Talking Clock voice library |
|
||||
| `brit-watch` | Brit Watch | talking | Steve's Talking Clock voice library |
|
||||
| `british-amy` | British Amy | talking | garrysblog/Speaking-Clock-MP3-Files |
|
||||
| `cepstral-duncan` | Cepstral Duncan | talking | Steve's Talking Clock voice library |
|
||||
| `cepstral-lawrence` | Cepstral Lawrence | talking | Steve's Talking Clock voice library |
|
||||
| `cobolt-talking-clock` | Cobolt Talking Clock | talking | Steve's Talking Clock voice library |
|
||||
| `cristo-the-australian-clock` | Cristo the Australian Clock | talking | Steve's Talking Clock voice library |
|
||||
| `derek-lanes-clock` | Derek Lane's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `docss-clock` | Doc'ss Clock | hourly | Steve's Talking Clock voice library |
|
||||
| `doubletalk-clock` | Doubletalk Clock | talking | Steve's Talking Clock voice library |
|
||||
| `echo-clock` | Echo Clock | talking | Steve's Talking Clock voice library |
|
||||
| `eloquence-clock` | Eloquence Clock | talking | Steve's Talking Clock voice library |
|
||||
| `fransisco-clock` | Fransisco Clock | talking | Steve's Talking Clock voice library |
|
||||
| `french-celine` | French Celine | talking | garrysblog/Speaking-Clock-MP3-Files |
|
||||
| `goldfingas-clock` | GoldFingas Clock | talking | Steve's Talking Clock voice library |
|
||||
| `hitachi` | Hitachi | talking | Steve's Talking Clock voice library |
|
||||
| `irish-clock` | Irish Clock | talking | Steve's Talking Clock voice library |
|
||||
| `james-bowdens-clock` | James Bowden's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `julies-clock` | Julie's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `kathleen-perdues-clock` | Kathleen Perdue's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `keaos-clock` | Keao's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `keynote-gold-clock` | Keynote Gold Clock | talking | Steve's Talking Clock voice library |
|
||||
| `larger-than-life` | Larger Than Life | talking | Steve's Talking Clock voice library |
|
||||
| `live-dectalk-betty` | DECtalk Beautiful Betty, live | tts | dectalk synthesiser |
|
||||
| `live-dectalk-dennis` | DECtalk Doctor Dennis, live | tts | dectalk synthesiser |
|
||||
| `live-dectalk-frank` | DECtalk Frail Frank, live | tts | dectalk synthesiser |
|
||||
| `live-dectalk-harry` | DECtalk Huge Harry, live | tts | dectalk synthesiser |
|
||||
| `live-dectalk-kit` | DECtalk Kit the Kid, live | tts | dectalk synthesiser |
|
||||
| `live-dectalk-paul` | DECtalk Perfect Paul, live | tts | dectalk synthesiser |
|
||||
| `live-dectalk-rita` | DECtalk Rough Rita, live | tts | dectalk synthesiser |
|
||||
| `live-dectalk-ursula` | DECtalk Uppity Ursula, live | tts | dectalk synthesiser |
|
||||
| `live-dectalk-wendy` | DECtalk Whispering Wendy, live | tts | dectalk synthesiser |
|
||||
| `live-mssam-mary` | Microsoft Mary, live | tts | mssam synthesiser |
|
||||
| `live-mssam-mary-tel` | Microsoft Mary for Telephone, live | tts | mssam synthesiser |
|
||||
| `live-mssam-mike` | Microsoft Mike, live | tts | mssam synthesiser |
|
||||
| `live-mssam-mike-tel` | Microsoft Mike for Telephone, live | tts | mssam synthesiser |
|
||||
| `live-mssam-sam` | Microsoft Sam, live | tts | mssam synthesiser |
|
||||
| `live-sam-elf` | SAM Elf, live | tts | sam synthesiser |
|
||||
| `live-sam-extra-terrestrial` | SAM Extra-Terrestrial, live | tts | sam synthesiser |
|
||||
| `live-sam-little-old-lady` | SAM Little Old Lady, live | tts | sam synthesiser |
|
||||
| `live-sam-little-robot` | SAM Little Robot, live | tts | sam synthesiser |
|
||||
| `live-sam-sam` | SAM, live | tts | sam synthesiser |
|
||||
| `live-sam-stuffy-guy` | SAM Stuffy Guy, live | tts | sam synthesiser |
|
||||
| `lucys-clock` | Lucy's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `maggies-clock` | Maggie's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `morse-code-clock` | Morse Code Clock | talking | Steve's Talking Clock voice library |
|
||||
| `neospeech-paul` | Neospeech Paul | talking | Steve's Talking Clock voice library |
|
||||
| `nfb-ttq` | NFB TTQ | talking | Steve's Talking Clock voice library |
|
||||
| `nick-gs-clock` | Nick G's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `nokia-tts` | Nokia TTS | talking | Steve's Talking Clock voice library |
|
||||
| `onjs-clock` | Onj's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `onjs-clock-ii` | Onj's Clock II | talking | Steve's Talking Clock voice library |
|
||||
| `outspoken` | Outspoken | talking | Steve's Talking Clock voice library |
|
||||
| `patrick-perdues-clock` | Patrick Perdue's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `pentatonic-windchimes` | Pentatonic Windchimes | chime | Steve's Talking Clock voice library |
|
||||
| `piano-major` | Piano Major | talking | Steve's Talking Clock voice library |
|
||||
| `piano-minor` | Piano Minor | talking | Steve's Talking Clock voice library |
|
||||
| `rainee-perdues-clock` | Rainee Perdue's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `rc-systems-repeater` | RC Systems Repeater | talking | Steve's Talking Clock voice library |
|
||||
| `retro-rsynth-clock` | Retro (rsynth) Clock | talking | Steve's Talking Clock voice library |
|
||||
| `rnc-clock` | RNC Clock | chime | Steve's Talking Clock voice library |
|
||||
| `sapi4-bonzibuddy` | BonziBUDDY (SAPI4 TruVoice) | tim | sapi4 synthesiser |
|
||||
| `sapi4-lh-jane` | L&H Jane (SAPI4) | tim | sapi4 synthesiser |
|
||||
| `sapi4-lh-reed` | L&H Reed (SAPI4) | tim | sapi4 synthesiser |
|
||||
| `sapi4-microsoft-mary` | Microsoft Mary (SAPI4) | tim | sapi4 synthesiser |
|
||||
| `sapi4-microsoft-mike` | Microsoft Mike (SAPI4) | tim | sapi4 synthesiser |
|
||||
| `sapi4-microsoft-mike-tel` | Microsoft Mike for Telephone (SAPI4) | tim | sapi4 synthesiser |
|
||||
| `sapi4-microsoft-sam` | Microsoft Sam (SAPI4) | tim | sapi4 synthesiser |
|
||||
| `sapi4-robosoft-one` | RoboSoft One (SAPI4) | tim | sapi4 synthesiser |
|
||||
| `sapi4-truvoice-female1` | TruVoice Adult Female #1 (SAPI4) | tim | sapi4 synthesiser |
|
||||
| `sapi4-truvoice-male1` | TruVoice Adult Male #1 (SAPI4) | tim | sapi4 synthesiser |
|
||||
| `satoki-talking-watch` | Satoki Talking Watch | talking | Steve's Talking Clock voice library |
|
||||
| `scansoft-isabel` | Scansoft Isabel | talking | Steve's Talking Clock voice library |
|
||||
| `scansoft-jane` | Scansoft Jane | talking | Steve's Talking Clock voice library |
|
||||
| `scansoft-jennifer` | Scansoft Jennifer | talking | Steve's Talking Clock voice library |
|
||||
| `scottish-clock` | Scottish Clock | talking | Steve's Talking Clock voice library |
|
||||
| `sharp-el-640` | Sharp EL-640 | talking | Steve's Talking Clock voice library |
|
||||
| `sharp-talking-time-i` | Sharp Talking Time I | talking | Steve's Talking Clock voice library |
|
||||
| `shawn-cleins-clock` | Shawn Clein's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `smooth-talker` | Smooth Talker | talking | Steve's Talking Clock voice library |
|
||||
| `steves-quacking-clock` | Steve's Quacking Clock | talking | Steve's Talking Clock voice library |
|
||||
| `talkbox-clock` | TalkBox clock | talking | Steve's Talking Clock voice library |
|
||||
| `tammy-cube-clock` | Tammy Cube Clock | talking | Steve's Talking Clock voice library |
|
||||
| `tim-gordon-gow` | Gordon Gow | tim | asterisk-tim |
|
||||
| `tim-pat-simmons` | Pat Simmons | tim | asterisk-tim |
|
||||
| `timex-speakeasy` | timex_speakeasy | talking | Steve's Talking Clock |
|
||||
| `tonys-clock` | Tony's Clock | talking | Steve's Talking Clock |
|
||||
| `toshiba-tts` | Toshiba TTS | talking | Steve's Talking Clock |
|
||||
| `valley-girl-clock` | Valley Girl Clock | talking | Steve's Talking Clock |
|
||||
| `voicer` | Voicer | talking | Steve's Talking Clock |
|
||||
| `voorslag` | voorslag | chime | Steve's Talking Clock |
|
||||
| `vox-clock-i` | Vox Clock I | talking | Steve's Talking Clock |
|
||||
| `vox-clock-ii` | Vox Clock II | talking | Steve's Talking Clock |
|
||||
| `vox-clock-iii` | vox clock III | talking | Steve's Talking Clock |
|
||||
| `vox-clock-iii-chimes` | vox clock III chimes | chime | Steve's Talking Clock |
|
||||
| `wild-animal-clock` | Wild Animal Clock | hourly | Steve's Talking Clock |
|
||||
| `yelling-clock` | Yelling Clock | talking | Steve's Talking Clock |
|
||||
| `timex-speakeasy` | timex_speakeasy | talking | Steve's Talking Clock voice library |
|
||||
| `tonys-clock` | Tony's Clock | talking | Steve's Talking Clock voice library |
|
||||
| `toshiba-tts` | Toshiba TTS | talking | Steve's Talking Clock voice library |
|
||||
| `valley-girl-clock` | Valley Girl Clock | talking | Steve's Talking Clock voice library |
|
||||
| `voicer` | Voicer | talking | Steve's Talking Clock voice library |
|
||||
| `voorslag` | voorslag | chime | Steve's Talking Clock voice library |
|
||||
| `vox-clock-i` | Vox Clock I | talking | Steve's Talking Clock voice library |
|
||||
| `vox-clock-ii` | Vox Clock II | talking | Steve's Talking Clock voice library |
|
||||
| `vox-clock-iii` | vox clock III | talking | Steve's Talking Clock voice library |
|
||||
| `vox-clock-iii-chimes` | vox clock III chimes | chime | Steve's Talking Clock voice library |
|
||||
| `wild-animal-clock` | Wild Animal Clock | hourly | Steve's Talking Clock voice library |
|
||||
| `yelling-clock` | Yelling Clock | talking | Steve's Talking Clock voice library |
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live dectalk:betty. Each sentence is spoken when
|
||||
; it is needed, by DECtalk's say, run here (tts_program_dectalk).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=DECtalk Beautiful Betty, live
|
||||
description=DECtalk 4.x, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:dectalk} -fo {out} -a "[:nb] {text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=dectalk
|
||||
voice=betty
|
||||
synthesiser=DECtalk (Digital Equipment Corp.), https://github.com/dectalk/dectalk
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live dectalk:dennis. Each sentence is spoken when
|
||||
; it is needed, by DECtalk's say, run here (tts_program_dectalk).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=DECtalk Doctor Dennis, live
|
||||
description=DECtalk 4.x, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:dectalk} -fo {out} -a "[:nd] {text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=dectalk
|
||||
voice=dennis
|
||||
synthesiser=DECtalk (Digital Equipment Corp.), https://github.com/dectalk/dectalk
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live dectalk:frank. Each sentence is spoken when
|
||||
; it is needed, by DECtalk's say, run here (tts_program_dectalk).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=DECtalk Frail Frank, live
|
||||
description=DECtalk 4.x, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:dectalk} -fo {out} -a "[:nf] {text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=dectalk
|
||||
voice=frank
|
||||
synthesiser=DECtalk (Digital Equipment Corp.), https://github.com/dectalk/dectalk
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live dectalk:harry. Each sentence is spoken when
|
||||
; it is needed, by DECtalk's say, run here (tts_program_dectalk).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=DECtalk Huge Harry, live
|
||||
description=DECtalk 4.x, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:dectalk} -fo {out} -a "[:nh] {text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=dectalk
|
||||
voice=harry
|
||||
synthesiser=DECtalk (Digital Equipment Corp.), https://github.com/dectalk/dectalk
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live dectalk:kit. Each sentence is spoken when
|
||||
; it is needed, by DECtalk's say, run here (tts_program_dectalk).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=DECtalk Kit the Kid, live
|
||||
description=DECtalk 4.x, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:dectalk} -fo {out} -a "[:nk] {text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=dectalk
|
||||
voice=kit
|
||||
synthesiser=DECtalk (Digital Equipment Corp.), https://github.com/dectalk/dectalk
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live dectalk:paul. Each sentence is spoken when
|
||||
; it is needed, by DECtalk's say, run here (tts_program_dectalk).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=DECtalk Perfect Paul, live
|
||||
description=DECtalk 4.x, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:dectalk} -fo {out} -a "[:np] {text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=dectalk
|
||||
voice=paul
|
||||
synthesiser=DECtalk (Digital Equipment Corp.), https://github.com/dectalk/dectalk
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live dectalk:rita. Each sentence is spoken when
|
||||
; it is needed, by DECtalk's say, run here (tts_program_dectalk).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=DECtalk Rough Rita, live
|
||||
description=DECtalk 4.x, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:dectalk} -fo {out} -a "[:nr] {text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=dectalk
|
||||
voice=rita
|
||||
synthesiser=DECtalk (Digital Equipment Corp.), https://github.com/dectalk/dectalk
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live dectalk:ursula. Each sentence is spoken when
|
||||
; it is needed, by DECtalk's say, run here (tts_program_dectalk).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=DECtalk Uppity Ursula, live
|
||||
description=DECtalk 4.x, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:dectalk} -fo {out} -a "[:nu] {text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=dectalk
|
||||
voice=ursula
|
||||
synthesiser=DECtalk (Digital Equipment Corp.), https://github.com/dectalk/dectalk
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live dectalk:wendy. Each sentence is spoken when
|
||||
; it is needed, by DECtalk's say, run here (tts_program_dectalk).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=DECtalk Whispering Wendy, live
|
||||
description=DECtalk 4.x, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:dectalk} -fo {out} -a "[:nw] {text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=dectalk
|
||||
voice=wendy
|
||||
synthesiser=DECtalk (Digital Equipment Corp.), https://github.com/dectalk/dectalk
|
||||
@@ -0,0 +1,21 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live mssam:mary-tel. Each sentence is spoken when
|
||||
; it is needed, by synth/mssam, run here (tts_program_mssam).
|
||||
; The synthesiser is ours; the voice data it reads is Microsoft's and is
|
||||
; not in this repository (tools/fetch-mssam.py downloads it); see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=Microsoft Mary for Telephone, live
|
||||
description=Microsoft Speech API 4 voice Mary, made for phone lines, by our own synthesiser, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:mssam} -v mary-tel -o {out} "{text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=mssam
|
||||
voice=mary-tel
|
||||
synthesiser=synth/mssam (this repository, clean-room) reading Microsoft's Speech API 4 voice data (msttsl.exe), fetched by tools/fetch-mssam.py
|
||||
@@ -0,0 +1,21 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live mssam:mary. Each sentence is spoken when
|
||||
; it is needed, by synth/mssam, run here (tts_program_mssam).
|
||||
; The synthesiser is ours; the voice data it reads is Microsoft's and is
|
||||
; not in this repository (tools/fetch-mssam.py downloads it); see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=Microsoft Mary, live
|
||||
description=Microsoft Speech API 4 voice Mary, by our own synthesiser, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:mssam} -v mary -o {out} "{text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=mssam
|
||||
voice=mary
|
||||
synthesiser=synth/mssam (this repository, clean-room) reading Microsoft's Speech API 4 voice data (msttsl.exe), fetched by tools/fetch-mssam.py
|
||||
@@ -0,0 +1,21 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live mssam:mike-tel. Each sentence is spoken when
|
||||
; it is needed, by synth/mssam, run here (tts_program_mssam).
|
||||
; The synthesiser is ours; the voice data it reads is Microsoft's and is
|
||||
; not in this repository (tools/fetch-mssam.py downloads it); see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=Microsoft Mike for Telephone, live
|
||||
description=Microsoft Speech API 4 voice Mike, made for phone lines, by our own synthesiser, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:mssam} -v mike-tel -o {out} "{text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=mssam
|
||||
voice=mike-tel
|
||||
synthesiser=synth/mssam (this repository, clean-room) reading Microsoft's Speech API 4 voice data (msttsl.exe), fetched by tools/fetch-mssam.py
|
||||
@@ -0,0 +1,21 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live mssam:mike. Each sentence is spoken when
|
||||
; it is needed, by synth/mssam, run here (tts_program_mssam).
|
||||
; The synthesiser is ours; the voice data it reads is Microsoft's and is
|
||||
; not in this repository (tools/fetch-mssam.py downloads it); see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=Microsoft Mike, live
|
||||
description=Microsoft Speech API 4 voice Mike, by our own synthesiser, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:mssam} -v mike -o {out} "{text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=mssam
|
||||
voice=mike
|
||||
synthesiser=synth/mssam (this repository, clean-room) reading Microsoft's Speech API 4 voice data (msttsl.exe), fetched by tools/fetch-mssam.py
|
||||
@@ -0,0 +1,21 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live mssam:sam. Each sentence is spoken when
|
||||
; it is needed, by synth/mssam, run here (tts_program_mssam).
|
||||
; The synthesiser is ours; the voice data it reads is Microsoft's and is
|
||||
; not in this repository (tools/fetch-mssam.py downloads it); see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=Microsoft Sam, live
|
||||
description=Microsoft Speech API 4 voice Sam, by our own synthesiser, spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:mssam} -v sam -o {out} "{text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=mssam
|
||||
voice=sam
|
||||
synthesiser=synth/mssam (this repository, clean-room) reading Microsoft's Speech API 4 voice data (msttsl.exe), fetched by tools/fetch-mssam.py
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live sam:elf. Each sentence is spoken when
|
||||
; it is needed, by SAM, run here (tts_program_sam).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=SAM Elf, live
|
||||
description=Software Automatic Mouth (Commodore 64, 1982), spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:sam} -wav {out} -speed 72 -pitch 64 -mouth 110 -throat 160 "{text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=sam
|
||||
voice=elf
|
||||
synthesiser=SAM, Don't Ask Software (now SoftVoice, Inc.), C port https://github.com/s-macke/SAM
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live sam:extra-terrestrial. Each sentence is spoken when
|
||||
; it is needed, by SAM, run here (tts_program_sam).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=SAM Extra-Terrestrial, live
|
||||
description=Software Automatic Mouth (Commodore 64, 1982), spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:sam} -wav {out} -speed 100 -pitch 64 -mouth 150 -throat 200 "{text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=sam
|
||||
voice=extra-terrestrial
|
||||
synthesiser=SAM, Don't Ask Software (now SoftVoice, Inc.), C port https://github.com/s-macke/SAM
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live sam:little-old-lady. Each sentence is spoken when
|
||||
; it is needed, by SAM, run here (tts_program_sam).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=SAM Little Old Lady, live
|
||||
description=Software Automatic Mouth (Commodore 64, 1982), spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:sam} -wav {out} -speed 82 -pitch 32 -mouth 145 -throat 145 "{text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=sam
|
||||
voice=little-old-lady
|
||||
synthesiser=SAM, Don't Ask Software (now SoftVoice, Inc.), C port https://github.com/s-macke/SAM
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live sam:little-robot. Each sentence is spoken when
|
||||
; it is needed, by SAM, run here (tts_program_sam).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=SAM Little Robot, live
|
||||
description=Software Automatic Mouth (Commodore 64, 1982), spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:sam} -wav {out} -speed 92 -pitch 60 -mouth 190 -throat 190 "{text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=sam
|
||||
voice=little-robot
|
||||
synthesiser=SAM, Don't Ask Software (now SoftVoice, Inc.), C port https://github.com/s-macke/SAM
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live sam:sam. Each sentence is spoken when
|
||||
; it is needed, by SAM, run here (tts_program_sam).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=SAM, live
|
||||
description=Software Automatic Mouth (Commodore 64, 1982), spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:sam} -wav {out} -speed 72 -pitch 64 -mouth 128 -throat 128 "{text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=sam
|
||||
voice=sam
|
||||
synthesiser=SAM, Don't Ask Software (now SoftVoice, Inc.), C port https://github.com/s-macke/SAM
|
||||
@@ -0,0 +1,20 @@
|
||||
; Live voice for app_speakingclock (docs/voice-format.md), made by
|
||||
; tools/synth_voices.py --live sam:stuffy-guy. Each sentence is spoken when
|
||||
; it is needed, by SAM, run here (tts_program_sam).
|
||||
; The synthesiser belongs to its owners; see NOTICE.md.
|
||||
|
||||
[voice]
|
||||
name=SAM Stuffy Guy, live
|
||||
description=Software Automatic Mouth (Commodore 64, 1982), spoken live
|
||||
mode=tts
|
||||
sequence=speech+pips
|
||||
period=10
|
||||
|
||||
[tts]
|
||||
command={program:sam} -wav {out} -speed 82 -pitch 72 -mouth 110 -throat 105 "{text}"
|
||||
text=At the third stroke, it will be {hour} {minute} {seconds}.
|
||||
|
||||
[source]
|
||||
engine=sam
|
||||
voice=stuffy-guy
|
||||
synthesiser=SAM, Don't Ask Software (now SoftVoice, Inc.), C port https://github.com/s-macke/SAM
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loaded 100 of 910 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user