diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-10-19 02:04:51 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-10-19 02:04:51 +0200 |
commit | d9e4a8c1b221e4e235eecd41862fdb96bacd9b08 (patch) | |
tree | 0dfc8f0cf2215bdde967ed747a87952ef35041d9 | |
parent | c72ce02c0db6672cd8109c67d1b3a52f07def02e (diff) |
Use stdin instead of args for text
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | greentext-voice.sh | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -1,7 +1,7 @@ A minimal script for text to speech using the meme greentext voice ## Usage -`greentext-voice.sh text goes here` +`echo -ne 'text goes here' | ./greentext-voice.sh` ## Dependencies coreutils, sed, curl, ffmpeg (ffplay) diff --git a/greentext-voice.sh b/greentext-voice.sh index 1394624..6e4c882 100755 --- a/greentext-voice.sh +++ b/greentext-voice.sh @@ -1,5 +1,5 @@ #!/bin/sh -text=$(echo "$*" | sed 's/</ less than /g; s/>/ greater than /g') +text=$(cat | sed 's/</ less than /g; s/>/ greater than /g') checksum=$(echo -n "415${text}1mp35883747uetivb9tb8108wfj" | md5sum | cut -d' ' -f1) curl -s "https://cache.oddcast.com/tts/gen.php" -d EID=4 -d LID=1 -d VID=5 -d "TXT=$text" -d IS_UTF8=1 -d EXT=mp3 -d FNAME= -d ACC=5883747 -d API= -d SESSION= -d "CS=$checksum" -d cache_flag=3 | ffplay -loglevel fatal -nodisp -autoexit - |