Add spelling improvements and local Piper TTS
Practice: fire streak badge, first-letter hint on wrong answers, missed-words drill session after practice completes. Test: audio-only mode with listening state before input appears, larger re-read button. Words: definition field (DB migration + admin editor + TTS playback). TTS: replace speechSynthesis with local Piper via /api/tts, WAV cached in data/tts-cache, falls back to browser voice when Piper is not installed. Dockerfile: switched to node:26-slim, installs Piper binary + en_US-lessac-medium voice. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
544469d6c9
commit
6f2281e2a7
8 files changed
+202
-35
No files matched your search
+18
-1
@@ -1,5 +1,22 @@
|
||||
FROM node:26-alpine
|
||||
FROM node:26-slim
|
||||
WORKDIR /app
|
||||
|
||||
# Install piper TTS binary and an English voice model
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN wget -qO /tmp/piper.tar.gz \
|
||||
https://github.com/rhasspy/piper/releases/download/v1.2.0/piper_linux_x86_64.tar.gz \
|
||||
&& tar -xzf /tmp/piper.tar.gz -C /tmp \
|
||||
&& mv /tmp/piper/piper /usr/local/bin/piper \
|
||||
&& rm -rf /tmp/piper*
|
||||
|
||||
RUN mkdir -p /app/voices \
|
||||
&& wget -qO /app/voices/en_US-lessac-medium.onnx \
|
||||
"https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx" \
|
||||
&& wget -qO /app/voices/en_US-lessac-medium.onnx.json \
|
||||
"https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx.json"
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
COPY . .
|
||||
|
||||
Reference in new issue
Block a user