30 lines
597 B
Bash
30 lines
597 B
Bash
|
#!/bin/bash
|
||
|
# https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video
|
||
|
# https://github.com/mozilla/TTS
|
||
|
#
|
||
|
|
||
|
if [ -z "$1" ]; then
|
||
|
echo usage: $0 \"filename\" [tempo] [model]
|
||
|
exit
|
||
|
fi
|
||
|
|
||
|
FILE=$1
|
||
|
STR=`cat $FILE`
|
||
|
MODEL="tts_models/en/jenny/jenny"
|
||
|
TEMPO=1.0
|
||
|
|
||
|
if [ -z "$2" ]; then
|
||
|
TEMPO=$TEMPO
|
||
|
else
|
||
|
TEMPO=$2
|
||
|
if [ -z "$3" ]; then
|
||
|
MODEL=$MODEL
|
||
|
else
|
||
|
MODEL=$3
|
||
|
fi
|
||
|
fi
|
||
|
|
||
|
tts --text "$STR" --model_name "$MODEL" && \
|
||
|
ffmpeg -i tts_output.wav -filter:a "atempo=$TEMPO" -vn ffmpeg_output.wav -y && \
|
||
|
ffplay ffmpeg_output.wav -nodisp -autoexit
|