So seq (count 100000000) is still just 1 argument, so it will return 1.Īlso, you can simplify all of your argument/flag parsing by spending time reading up on argparse. count works by counting the arguments without any regard to the value they contain. This statement will always return just one number. batch-gtts.fish -b "word1,word2,word3,word4"Īnd it will say 'word4', and nothing else. Mv -i ~/.cache/gtts-output.ogg $outputFileNameįfmpeg -i ~/.cache/gtts-output.ogg $outputFileName 2>/dev/nullĮxample operation: #. If test (echo $outputFileName | choose -f \\. Set outputFileExtension (echo $outputFileName | choose -f \\. If test $keepOutput = True if test $batchOp = True If test $speakOutput = True if test $batchOp = TrueĬvlc -play-and-exit ~/.cache/gtts-output.ogg 2>/dev/null Gtts-cli (echo $i | choose -f, 0) -l $argv -output ~/.cache/gtts-output(seq (count $batchList)).oggĮlse if test $argv = "-blns" set speakOutput FalseĮlse if test $argv = "-blnsf" set speakOutput False Gtts-cli -f (echo $i | choose -f, 0) -l $argv -output ~/.cache/gtts-output(seq (count $batchList)).oggĮlse if test $argv = "-bl" set speakOutput True Gtts-cli (echo $i | choose -f, 0) -output ~/.cache/gtts-output(seq (count $batchList)).oggĮlse if test $argv = "-bsf" set speakOutput TrueĮlse if test $argv = "-bsfn" set speakOutput FalseĮlse if test $argv = "-bsfnl" set speakOutput False Gtts-cli -f (echo $i | choose -f, 0) -output ~/.cache/gtts-output(seq (count $batchList)).oggĮlse if test $argv = "-bs" set speakOutput True Gtts-cli $i -output ~/.cache/gtts-output(seq (count $i)).oggĮlse if test $argv = "-bf" set speakOutput True If test $argv = "-b" set speakOutput True The for loop does not iterate as it should. It temporarily saves the output in ~/.cache, and moves it to the desired output file if specified, converting it with ffmpeg if the file extension doesn't match the default (ogg). It first takes options to set a specific language, or whether to save the output as a file, and if so, whether to speak it out loud or not. The script is supposed to automate transcribing text using gtts-cli.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |