mirror of
https://github.com/D-Modem/speaking-clock.git
synced 2026-11-28 12:38:05 -08:00
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
40 lines
1.5 KiB
Bash
Executable File
40 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
# Download the voice sources that tools/build_voices.py turns into voices/.
|
|
# Usage: tools/fetch-sources.sh [DIR] (default: ./sources)
|
|
# Needs curl, git, unzip and 7z (p7zip) or innoextract for the installers.
|
|
# Nothing downloaded is run: the Windows installers are only unpacked.
|
|
set -eu
|
|
DIR=${1:-sources}
|
|
mkdir -p "$DIR/steve/dl" "$DIR/steve/x"
|
|
|
|
# 1. Steve's Talking Clock voices (http://clock.steve-audio.net/voices/)
|
|
STEVE=http://clock.steve-audio.net/voices/
|
|
curl -fsSL "$STEVE" | grep -o 'href="[^"]*"' | sed 's/^href="//; s/"$//' |
|
|
grep -E '\.(exe|zip)$' | while read -r url; do
|
|
name=$(printf '%s' "${url##*/}" | python3 -c 'import sys,urllib.parse;print(urllib.parse.unquote(sys.stdin.read()))')
|
|
[ -s "$DIR/steve/dl/$name" ] && continue
|
|
echo "fetch $name"
|
|
curl -fsSL -o "$DIR/steve/dl/$name" "$url"
|
|
done
|
|
for f in "$DIR"/steve/dl/*; do
|
|
base=$(basename "$f"); out="$DIR/steve/x/${base%.*}"
|
|
[ -d "$out" ] && continue
|
|
mkdir -p "$out"
|
|
case "$f" in
|
|
*.zip) unzip -oq "$f" -d "$out" ;;
|
|
*.exe) 7z x -y -o"$out" "$f" >/dev/null 2>&1 ||
|
|
innoextract -s -d "$out" "$f" >/dev/null ;;
|
|
esac
|
|
done
|
|
|
|
# 2. garrysblog/Speaking-Clock-MP3-Files
|
|
[ -d "$DIR/garry" ] ||
|
|
git clone -q --depth 1 https://github.com/garrysblog/Speaking-Clock-MP3-Files.git "$DIR/garry"
|
|
|
|
# 3. paulseward/asterisk-tim
|
|
[ -d "$DIR/asterisk-tim" ] ||
|
|
git clone -q --depth 1 https://github.com/paulseward/asterisk-tim.git "$DIR/asterisk-tim"
|
|
|
|
echo "sources in $DIR"
|