Add crunch presets, echo options, and streaming word mode
This commit is contained in:
@@ -119,6 +119,23 @@ VESKSLOP_TTS_VOICE=keith-bell VESKSLOP_TTS_PRESET=vox VESKSLOP_TTS_WORDS=1 \
|
||||
check "implied VOX yields to word mode" "3" "$(grep -c '^ARGV:' "$STUB_LOG")"
|
||||
check "implied VOX skipped for words" "0" "$(grep -c 'wH1' "$STUB_LOG")"
|
||||
|
||||
# Crunch keeps the output contract and changes the sound.
|
||||
VESKSLOP_TTS_VOICE=keith-bell run_wrapper
|
||||
cp "$WORK/out.wav" "$WORK/off.wav"
|
||||
VESKSLOP_TTS_VOICE=keith-bell VESKSLOP_TTS_CRUNCH=telephone run_wrapper
|
||||
check "crunch keeps 48k s16le" "pcm_s16le,48000,1" \
|
||||
"$("${MICROSLOP_FFMPEG:-ffmpeg}" -hide_banner -loglevel error -i "$WORK/out.wav" -f null - 2>&1 >/dev/null; ffprobe -v error -show_entries stream=codec_name,sample_rate,channels -of csv=p=0 "$WORK/out.wav")"
|
||||
check "crunch changes the audio" "1" "$([ "$(md5sum < "$WORK/off.wav")" != "$(md5sum < "$WORK/out.wav")" ] && echo 1 || echo 0)"
|
||||
|
||||
# Streaming word mode writes a live WAV with a gap between each pair of words.
|
||||
VESKSLOP_TTS_VOICE=keith-bell VESKSLOP_TTS_WORDS=1 VESKSLOP_TTS_WORD_GAP_MS=200 \
|
||||
VESKSLOP_TTS_STREAM=1 run_wrapper
|
||||
check "stream header" "RIFF" "$(head -c 4 "$WORK/out.wav")"
|
||||
check "stream is decodable" "0" \
|
||||
"$("${MICROSLOP_FFMPEG:-ffmpeg}" -hide_banner -loglevel error -i "$WORK/out.wav" -f null - >/dev/null 2>&1; echo $?)"
|
||||
check "stream has a gap per word break" "2" \
|
||||
"$("${MICROSLOP_FFMPEG:-ffmpeg}" -hide_banner -i "$WORK/out.wav" -af silencedetect=noise=-45dB:d=0.15 -f null - 2>&1 | grep -c silence_start)"
|
||||
|
||||
# Voice metadata follows the active preset.
|
||||
check "voices reflect hev" "1" \
|
||||
"$(VESKSLOP_TTS_PRESET=hev sh "$WRAP" --voices | tr ',' '\n' | grep -c 'keith-bell|Keith Bell|male|en|expression=59+defaults=pitch:15:rate:24')"
|
||||
|
||||
Reference in New Issue
Block a user