You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1018 B
39 lines
1018 B
#!/bin/sh
|
|
|
|
main_dir="$( cd "$( dirname "$0" )" && pwd )"
|
|
|
|
shopt -s nocasematch
|
|
|
|
for subfolder in "$main_dir"/*; do
|
|
if [ -d "$subfolder" ]; then
|
|
audiofolder="$subfolder/Audio"
|
|
mkdir -p "$audiofolder"
|
|
|
|
for entry in "$subfolder"/*.txt; do
|
|
fn=$(basename "$entry")
|
|
[[ "${entry##*.}" =~ txt ]]
|
|
|
|
echo "$fn"
|
|
inputfile="$subfolder/$fn"
|
|
outputfile="$audiofolder/${fn%.*}.m4b"
|
|
|
|
now=$(date +"%T")
|
|
echo "Current time : $now"
|
|
echo "$inputfile ->"
|
|
echo "$outputfile"
|
|
|
|
if [ -f "$outputfile" ]; then
|
|
echo "$outputfile exists: skipping"
|
|
else
|
|
say --voice=Sinji \
|
|
--output-file="$outputfile" \
|
|
--input-file="$inputfile" \
|
|
--file-format=m4bf \
|
|
--quality=127 \
|
|
-r 200 \
|
|
--data-format=aac
|
|
fi
|
|
done
|
|
fi
|
|
done
|