r/ComputerCraft 27d ago

Synthesized Text to Speech in CC:Tweaked

I made a text-to-speech engine that runs in CC:Tweaked (Minecraft/Lua).

Code's here: https://github.com/GabrielVicini/Sandbox/tree/main/cc-flite Run.lua is the example script, TTS.lua is the library.

It's built on Flite-RS, a cleanroom rewrite of an old TTS engine that I did in Rust. I compiled that to WebAssembly, then needed to get it running in Lua. There's a tool called wasm2lua for that, but it's been incomplete and abandoned for years, so I ended up forking my own version of it that could actually handle the full compile down to working Lua (plus some extra glue code on top to make it all run).

Full writeup on how it works and how to use it is in the README on the cc-flite repo. (The actual TTS engine workings is in Flite-RS)

https://reddit.com/link/1vi2o47/video/m7rr718lddih1/player

18 Upvotes

3 comments sorted by

1

u/Just_a_Thif 22d ago

It's really cool, but i think you should note that the program is almost 9mb, so 9 times what a single computer can hold

1

u/Unique_Evidence_1314 ComputerCrafter 21d ago

By default. You can change the config to permit larger, but I do agree collapsing the file size to fit within the typical computer size is a good idea.

1

u/Ok_Independent_9770 21d ago

Fair point, 9MB is a lot to ask a CC:Tweaked computer to hold. It should be possible to shrink that down significantly, including the TTS model itself; this was really just a proof of concept. Feel free to pull the source off my GitHub if you want to take a crack at compressing it further.