diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..928bcdc --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +venv/ + diff --git a/README.md b/README.md index 72951b0..2adc1b3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ # final-space-tts -Listen to Final Space quotes from KVN, H.U.E. or A.V.A! \ No newline at end of file +Listen to Final Space quotes from KVN, H.U.E. or A.V.A! + +Requires `espeak-ng` (or plain old `espeak`), `python3` and `mpg321`. + +Voice quality is fairly shitty. They don't sound like A.V.A., H.U.E. or KVN that much. But hey, it's free, and it might give you a laugh. + diff --git a/apt-packages.list b/apt-packages.list new file mode 100644 index 0000000..884d350 --- /dev/null +++ b/apt-packages.list @@ -0,0 +1,2 @@ +espeak-ng espeak-ng-data libespeak-ng1 mpg321 + diff --git a/quote_final_space.sh b/quote_final_space.sh new file mode 100755 index 0000000..7d674d9 --- /dev/null +++ b/quote_final_space.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env sh + +set -eu + +working_dir="$(dirname "$0")" + +if [ ! -d "$working_dir/venv" ]; then + echo "preparing python virtualenv" + python3 -m venv --system-site-packages "$working_dir/venv" >/dev/null + echo "installing python pip requirements" + python3 -m pip install -U -r "$working_dir/requirements.txt" >/dev/null +fi + +supported="KVN, HUE, AVA" + +do_notify() { notify-send "$1 says:" "\"$2\"" ; } + +if [ $# -eq 0 ]; then + echo "Requires an argument (must be one of $supported)" >&2 + exit 1 +fi + +LINE="$(shuf -n 1 "$working_dir"/quotes.txt)" +case $1 in + [Aa][Vv][Aa]) + # shellcheck disable=SC1091 + . "$working_dir/venv/bin/activate" + gtts-cli -l 'en' -o '/tmp/ava.mp3' "$LINE" + do_notify "A.V.A" "$LINE" & + mpg321 --stereo >/dev/null 2>&1 '/tmp/ava.mp3' + ;; + [Hh][Uu][Ee]) + do_notify "H.U.E." "$LINE" & + espeak-ng -a 200 -p 55 -s 126 -v "en-us" "$LINE" + ;; + [Kk][Vv][Nn]) + do_notify "KVN" "$LINE" & + espeak-ng -a 200 -p 110 -s 160 -v "en-us" "$LINE" + ;; + *) + echo "Invalid choice (must be one of $supported)" >&2 + exit 1 + ;; +esac diff --git a/quotes.txt b/quotes.txt new file mode 100644 index 0000000..5264f6e --- /dev/null +++ b/quotes.txt @@ -0,0 +1,52 @@ +Tough titty wompus! +Well, twist my nipples hard! +Oh my crap... +Oh my double crap! +Hell yeah, dawg. +Gary, the cookies are done. +Get off my cheeks, Gary. +I am a god. +Is that life, Gary? +What the hell, Quinn? You failed to mention me. +Sorry to be the bearer of bad news, but we're still in extreme danger. Those dickheads from the Infinity Guard found us, and Gary is not responding. +You're my only friend, Gary. +Kevin is a jag-off, Gary. You know that. +Detonating in 3... 2... 1. Boom town. +I'd give you a cookie, but I think you've out-grown that. +I'll miss you, friend. +It's been an honor to be your friend. +My body is a nightmare. +Gary, may I speak in...ironics? Haha, you are a prisoner once again. +My first high-five, and it was a threesome... No one would believe me. +I have no idea what I just made you, or if it even tastes good. +Alright, this is how we play the game! +Whoa! I really am a god. +Have I really sunk this low... +Either he's distracted, or he's had breakfast. +Does anyone want a hit of this Hue-bie doobie? +This puts the Hue in humiliation +Is it hot in here, or is it just Hue? +If you believe something can be broken, you must also believe it can be fixed. +But when will someone fix Hue? +Kevin, if you don't get on the outside turret, I will beat you within one inch of your life. +I... I wish I knew how to cry. +Hey Gary, my name is Kevin. I'm your Deep Space Insanity Avoidance Companion, nice to meet you! +I have the key! In my butthole. +Embrace the Kevin! +Kevin saves the day! +They're just soooooo good! +But I call it the Tiger's Nest! +This is so wrong, this is so very wrong. +Hey, let's do jello shots with the brain goo! +Uh, can I help you...? Run away! RUN AWAY! +Do my bidding. Fix the ship! +Flamethrowers! Hooray! +The winds of change keep blowing, we're all gonna die. +Oh baby Kevin's got the magic, and the magics got Kevin... +Hi Future Quinn, I'm Kevin, I'm Gary's Deep Space Insanity Avoidance Companion! +I'm burning you alive tonight. Yes, I'm burning you alive tonight. While you sleep? You bet! I'm burning you alive tonight! +I'm backkkk! +It bounces forever... got it from a dead guy. +Greetings, insane worshippers! +Is anything real, or is this a beautiful lie? +Hooray! Kevin will never die. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..fc165c1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +gTTS==2.2.3