Created
May 5, 2019 12:23
-
-
Save southpolemonkey/d8dc8ed3827b4cc84f142c0ce475d82d to your computer and use it in GitHub Desktop.
bash function which utilise text-to-speech command to pronounce english vocabulary, with customer file and rate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
pronounce_word () { | |
declare -a myArray | |
# echo "$args" | |
# myArray=(`cat "$args"`) | |
myArray=(`cat $dir`) | |
say "test begin[[slnc 2000]]" | |
for i in "${myArray[@]}" | |
do | |
say "$i [[slnc $duration]]" #change number to custom pause duration | |
done | |
} | |
# args=("$@") | |
if test $# = 2 | |
then | |
dir=$1 | |
duration=$2 | |
else | |
echo "Usage: script <filename> <pause_duration>" 1>&2 | |
exit 1 | |
fi | |
echo "$dir" | |
# echo "$duration" | |
pronounce_word |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment