aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvulonkaaz <7442677+vulonkaaz@users.noreply.github.com>2026-04-21 23:25:07 +0200
committervulonkaaz <7442677+vulonkaaz@users.noreply.github.com>2026-04-21 23:25:07 +0200
commit89a347c941b67d46f6910cd8560384af1b1e9275 (patch)
tree107087d103870cef1598679fdd116c605993b932
first commit
-rw-r--r--LICENSE13
-rw-r--r--README.md23
-rwxr-xr-xtts.sh8
-rw-r--r--tts/init.lua4
-rw-r--r--tts/mod.conf1
5 files changed, 49 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..ad1989f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,13 @@
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ Version 2, December 2004
+
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
+
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. You just DO WHAT THE FUCK YOU WANT TO. \ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..cb73639
--- /dev/null
+++ b/README.md
@@ -0,0 +1,23 @@
+# TTS client mod for minetest
+
+This mod is quite janky and need special tweaking for it to work
+
+## How it works
+
+- a CSM logs every chat message into stderr
+- stderr get piped into a shell script
+- the shell script send the chat messages to espeak (along with a randomized pitch based on the username)
+
+## Requirement
+
+- a somewhat POSIX compliant system, linux works, i guess BSD and macOS work too, do not ask me how to make this work on windows
+- espeak (or any TTS engine that can read from stdin, modify the shell script if you use another one)
+
+## How to use
+
+- copy the tts folder to your clientmods folder & turn on the client side mods
+- launch minetest with `minetest 2>&1 >/dev/null | ./tts.sh` (replace minetest and tts.sh with the actual paths of those files on your system)
+
+## Support and troubleshooting
+
+Read the source code to understand what the hell is going on, this software is offered with no support nor warranty
diff --git a/tts.sh b/tts.sh
new file mode 100755
index 0000000..089ca33
--- /dev/null
+++ b/tts.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+grep --line-buffered -F "[CHATTTS]"|grep --line-buffered -F "<"|while read line
+do
+ pitch=$(echo $line|awk -F"[<>]" '{print $2}'| sha256sum | grep -Eo "[[:digit:]]{2}" | head -n1)
+ msg=$(echo $line|sed 's/@#[A-Za-z0-9]\{6\})//g;s/^[^>]*>//')
+ echo $msg|espeak -p $pitch
+done
diff --git a/tts/init.lua b/tts/init.lua
new file mode 100644
index 0000000..05db6a4
--- /dev/null
+++ b/tts/init.lua
@@ -0,0 +1,4 @@
+core.register_on_receiving_chat_message(function(message)
+ core.log("action", "[CHATTTS] " .. message)
+ return false
+end)
diff --git a/tts/mod.conf b/tts/mod.conf
new file mode 100644
index 0000000..ea4eccf
--- /dev/null
+++ b/tts/mod.conf
@@ -0,0 +1 @@
+name = tts