diff --git a/speak-file-mp3.sh b/speak-file-mp3.sh new file mode 100755 index 0000000..851adf2 --- /dev/null +++ b/speak-file-mp3.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +FILE="ffmpeg_output.wav" +MP3="ffmpeg_output.mp3" + +ffmpeg -i $FILE -acodec mp3 $MP3 -y +ffplay $MP3 -nodisp -autoexit diff --git a/speak-file-slobot.sh b/speak-file-slobot.sh new file mode 100755 index 0000000..53a1421 --- /dev/null +++ b/speak-file-slobot.sh @@ -0,0 +1,25 @@ +#!/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] + 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 +fi + +tts --text "$STR" --model_name "$MODEL" && \ +ffmpeg -i tts_output.wav -filter:a "atempo=$TEMPO" -vn ffmpeg_output.wav -y && \ +ffmpeg -i ffmpeg_output.wav -acodec mp3 $FILE.mp3 -y && \ +ffplay $FILE.mp3 -nodisp -autoexit diff --git a/speak-file-slomo.sh b/speak-file-slomo.sh new file mode 100755 index 0000000..ba08160 --- /dev/null +++ b/speak-file-slomo.sh @@ -0,0 +1,25 @@ +#!/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] + exit +fi + +FILE=$1 +STR=`cat $FILE` +MODEL="tts_models/en/ljspeech/glow-tts" +TEMPO=1.0 + +if [ -z "$2" ]; then + TEMPO=$TEMPO +else + TEMPO=$2 +fi + +tts --text "$STR" --model_name "$MODEL" && \ +ffmpeg -i tts_output.wav -filter:a "atempo=$TEMPO" -vn ffmpeg_output.wav -y && \ +ffmpeg -i ffmpeg_output.wav -acodec mp3 $FILE.mp3 -y && \ +ffplay $FILE.mp3 -nodisp -autoexit diff --git a/speak-file.sh b/speak-file.sh new file mode 100755 index 0000000..38484e3 --- /dev/null +++ b/speak-file.sh @@ -0,0 +1,29 @@ +#!/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