Move the build options, the timing notes, the Asterisk, FreeSWITCH,
FreePBX and live-voice instructions and the voice rebuild steps into
topic files in docs/. The README keeps the voices, the parts, a quick
start and an index.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSvurgAXJHmd8Fs4ud
The 129-tap correction filter could not tell 125 Hz from 250 Hz, so the
fit had piled a boost at 250 Hz that smeared over the bass. The filter
now has 1023 taps and points at 80, 180, 350 and 700 Hz too, set so that
the long-term spectrum below 1 kHz matches his recordings within 1 dB
(it was 4 dB short at 100-150 Hz and 2 dB over at 150-300 Hz).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
Sam's vowels came out with flatter formants than his (4.3 dB of
peak-to-valley contrast between 300 Hz and 4 kHz, against his 5.4),
which sounds muddy. The score now compares that contrast too; the refit
strengthens the postfilter (0.71/0.87) and reshapes the tone correction,
and the contrast now matches (5.30 against 5.39).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
The first fit made each pitch pulse less like the one before (periodicity
0.68 against his 0.84), which sounds rough and buzzy. The score now also
compares how steady the pulses are, overall, at 1-2.5 kHz and above 2.5
kHz; the refit smooths the pulses far more (0.95, up to 4.8 kHz) and
matches his steadiness on the held-back recordings (0.83/0.40/0.13
against 0.84/0.40/0.13). Speech recognition on the clock phrases: -0.57
-> -0.54. The filter-gain loudness rule fitted to zero and is removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
A fit over 26 settings against 30 recordings of real Sam (each frame of
ours matched to the same moment in his: tone, loudness over time, and
length), checked on 10 held-back recordings, where the distance fell from
1.00 to 0.66. The pitch pulses' harmonics are now flattened, hiss is
louder, the treble lift and the pulse smoothing are lighter, and the tone
correction lifts the bass and lower midrange. Speech recognition on the
clock phrases also improved (-0.59 -> -0.57).
The loudness no longer glides across a change between a voiced frame and
hiss, which made the start of a hiss as loud as the vowel before it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
make builds app_speakingclock and mod_speakingclock for whichever PBX
headers are installed (or PBX=...), synth/mssam and synth/macintalk,
sclock-render, and fetches the Microsoft and Apple voice data from the
Internet Archive into sources/. make install runs each part's install.
macintalk now takes VOICEDIR from PREFIX like mssam does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSErpfiUMyvxPjp5Am
The loudness stepped at every frame (and for Sam, with the filter's gain
taken out per frame, jumped further), which sounded choppy. It now glides
with the spectrum in 32-sample steps, the filter's gain worked out at each
step. Level jitter within words: 1.83 dB -> 1.29 (his: 1.15).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
- Each frame's stored gain is now taken as the loudness of the sound,
not of its excitation (Sam only): his 'm' was 5 dB louder than the
vowel before it, where his recordings have it 10 dB quieter.
- A vowel unit that starts with the faded tail of the hiss before it
('Sam') is held up to the hiss, which removes a gap.
- A sentence's stressed last vowel is held 1.3x and what follows it
clipped to 0.7x, as in his recordings.
- More 1-3 kHz in Sam's tone correction.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
Each frame of ours is matched to the same moment in his recordings and
the tone correction refitted from the difference: more fundamental and
1-2 kHz, less above 2.5 kHz. Pitch pulses are blended only below 2 kHz,
which took away a buzz above it, and s/f/th play 1.3x quicker than the
vowels, as his do. Distance to his recordings: 0.45 -> 0.37.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
The speakingclock dialplan application: the same voices, options and
second-accurate timing as Asterisk's SpeakingClock(), including the live
synthesiser voices (mode=tts).
- core/: the clock itself, ported from app_speakingclock with Asterisk's
APIs taken out (libc, libm and pthreads only), and sclock-render, which
writes what a caller would hear without a PBX. Its output matches
Asterisk's "speakingclock render" sample for sample.
- freeswitch/: mod_speakingclock, its Makefile, speakingclock.conf.xml
and a dialplan example. API: speakingclock voices | render | reload.
- test/render_test.py runs against FreeSWITCH with PBX=freeswitch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRNr2N8eMYr1uzZqwk
In Victoria high quality (and others) a b before r has no burst, only a
quick start of voicing; stretching it with the rest of the sound made it
a glide, and "brown" was heard as "own". The voiced stops are now put
out as recorded, with their length made up in the closure. Word error
rate over the test sentences: 17.9% to 17.0%.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRAKCKq1gSHpownvFE
Word by word against real Sam: content words rise further (first by 32 Hz,
later ones by 22), the base line sinks less, a word before a comma keeps
its rise and falls only to 98 Hz, a sentence's last word is not stressed
when another word is, and secondary stress and 'this'/'that' stay plain.
Sam's vowels lacked 2.5-4 kHz and had extra hiss above 4 kHz, and his
s, f and th were quieter: the tone correction now lifts 2.5-4 kHz and not
the top, and hiss sounds are 2.6 dB louder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
Sam gets a codec-style postfilter, A(z/0.5)/A(z/0.75) with its tilt taken
back out, which clears the haze between formants. The filter now rings out
into pauses, a shortened pitch period fades over its last eighth, and the
compressor's level window is 40 ms so it does not ripple at pitch rate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
They had no wave-phoneme, so they came out as silence ("jumps" as
"umps"). The voices make them of t and sh, d and zh: the stop takes
the phoneme's closure segment and the hiss the rest. Word error rate
over the test sentences falls from 23% to 18%.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRAKCKq1gSHpownvFE
Agnes, Bruce and Victoria high quality now decode and speak: their units
are on 8-byte boundaries and their codebook has 2-sample vectors. The
fetch script keeps them (as agnes-hq.gtss and so on), with live voices
live-plaintalk-*-hq.
Unit offsets above 0xffff were skipped when counting units, which put
the period lists out of step with the units in every voice; fixing that
brings the recogniser's word error rate down from about 30% to 23%.
The base pitch is now the median recorded period, not header word 1
(70 in Victoria high quality, which is wrong).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRAKCKq1gSHpownvFE
Measured against Sam's own recordings of the clock's phrases, our Sam
was 3-6 dB too dark above 2.5 kHz (Mike and Mary were not). A
linear-phase correction for Sam only brings it within about 1 dB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
A PlainTalk unit is one continuous stretch of sound cut into frames of N
samples, and the lag byte plus N - 1 is the pitch period (it matches the
recorded period lengths). The frames were being treated as one pitch
period each and resampled, which clicked at every frame: the crackle.
Units are now decoded as a signal (the short last frame too), the recorded
period lengths are its pitch marks, and TD-PSOLA sets each phoneme's
pitch and length. A 6 kHz low-pass takes off the hiss of the 2-bit coding.
The PlainTalk voices also slow down and fall much less at the end of a
phrase (final_k).
Whisper base.en word errors over ten sentences: 36% before, 28% now
(Agnes 17%, Bruce and Victoria 34%).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRAKCKq1gSHpownvFE
The stored pitch pulses vary much more from one to the next than Sam's
own speech (how alike neighbouring periods are: 0.41 against Sam's 0.62),
which sounds rough; each pulse is now blended with the one before (0.57).
The gap between loud vowels and quiet consonants is narrowed a little
(ours were about 4 dB quieter than Sam's). Speech recognition's
confidence on Sam's clock phrases goes from -0.83 to -0.69 (Sam's own
recordings: -0.66).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
The pitch now follows the shape of Sam's recordings: a phrase starts near
100 Hz, the first stressed word rises above it, and it sinks to about
73 Hz at the end, instead of stepping between fixed tones. A unit's first
frames lean toward the loudness of the unit before (joins jumped about
three times as much as frames inside a unit), and stored pitch periods
are resampled through their spectrum. Speech recognition is surer of the
result on Sam's clock phrases and on other sentences.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
The PlainTalk (MacinTalk Pro) voices are recorded diphones. plaintalk.c
reads a voice's 'gtss' 3 data: the two 50 x 50 diphone tables, the
period lengths, the codebook, and the coded periods, each the signal a
period plus a lag back plus gain times codebook vectors. It joins the
half-diphones with the text front end, timing and pitch macintalk already
has. docs/plaintalk-format.md describes the data; no Apple code is used.
tools/fetch-macintalk.py also fetches a Mac OS 8.6 disk image from the
Internet Archive (pinned by SHA-256; it needs unar or unrar to unpack) and
writes agnes.gtss, bruce.gtss and victoria.gtss. The high quality voices
are coded differently and are left out for now.
tools/synth_voices.py gets a plaintalk engine, and voices/ the three
live-plaintalk-* voices. Whisper (base.en) gets the clock sentence word
for word from all three; over ten test sentences about 30-40% of words
are wrong.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRAKCKq1gSHpownvFE
Our output had about 10 dB less treble than the voices' recordings, which
made S, F and T dull; a treble lift on the output now matches it. The
spectrum also glides between frames instead of jumping. Adds the 8 kHz
telephone voices (male8.vce and female8.vce) as mike-tel and mary-tel,
with live-mssam-mike-tel and live-mssam-mary-tel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
synth/mssam reads the voice data of Microsoft's Speech API 4 voices and
speaks with it: the voice's context trees pick a recorded unit for each
sound, and the units are joined with new pitch (from the voice's tone
table) and timing. No Microsoft code is used or run. tools/fetch-mssam.py
downloads msttsl.exe at build time and keeps only the voice data.
docs/mssam-format.md describes the data. Adds live-mssam-sam, -mike and
-mary, and an mssam engine in tools/synth_voices.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
synth/macintalk is a clean-room speech synthesiser for Linux that speaks
with the MacInTalk 3 voices of classic Mac OS (Fred, Ralph, Kathy, Zarvox,
the singing and novelty voices). It runs no Apple code. It reads only the
voices' data ('ttvd' parameters and 'ttvw' samples), which
tools/fetch-macintalk.py takes from a Mac OS 8.1 disk image on the
Internet Archive at build time, with its own small HFS reader. Apple's
files stay out of the repository.
The voice data gives the pitch, rate, glottal source spectra, formant
shifts and bandwidths, breathiness, chorus, tunes and sampled sounds
(docs/macintalk-format.md). The text front end (NRL letter-to-sound rules,
public domain), prosody and Klatt-style formant synthesis are ours.
tools/synth_voices.py gets a macintalk engine (clips and --live), and
voices/live-macintalk-* run it through mode=tts (tts_program_macintalk).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRAKCKq1gSHpownvFE
- tools/synth_voices.py makes clip voices from speech synthesisers
(SAPI4 via tetyys.com, DECtalk, SAM, MacInTalk), and live voices.
- Eight SAPI4 clip voices: Microsoft Sam, Mike, Mary, Mike for
Telephone, BonziBUDDY, TruVoice male and female, RoboSoft One.
- mode=tts: the module runs a synthesiser program on the Asterisk
machine for each announcement's whole sentence, in a worker thread
and ahead of time, so a call never waits on it. live-dectalk-* and
live-sam-* voices; tts_program_* and tts_timeout settings, also in
the FreePBX module.
- module reload now rereads the voices even when speakingclock.conf
is unchanged.
- tools/voice_index.py writes voices/INDEX.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
app_speakingclock adds SpeakingClock(), which places each announcement by
sample against the system clock, so the time mark (the third pip) lands on
the second it announces, as on the real machines. Voices are folders of
8 kHz WAV clips with a voice.conf; the module supports TIM-style
(phrase, hour, minute, seconds, pips), talking-clock, chime and hourly
voices.
voices/ holds the asterisk-tim pair (Pat Simmons, Gordon Gow), garrysblog's
Amy and Celine, and the Steve's Talking Clock library, converted by
tools/build_voices.py from what tools/fetch-sources.sh downloads. The
recordings belong to their original owners (NOTICE.md); the code is
GPL-2.0-or-later.
freepbx/speakingclock is a FreePBX module: clocks as destinations, with
optional numbers to dial, and speakingclock.conf from its settings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs