Modding, Mission Design, and Coding > The Scripting Workshop

[Alpha release] Multi-Voice Cross-Platform Text-To-Speech

(1/2) > >>

As some of you might have noticed from my cries for help in here & on Discord, I was busy making something, here it is:

TTS on Linux
& possibly more to come
First of all, a big thanks to m!m for his patience with my inexperienced questions. I learned tons about FSO doing this.

A new version without the need for a buffer file is now available on GitHub:
Grab it via Code/Download ZIP

What it does:
- Send any nonVAed message to festival
- Receive the spoken message
- Buffer it to disk
- Load & play it

What it needs:
- lua51_socket, or however that is called on your distro
- festival, the free and open source TTS software, running in server mode on port 1314 ($ festival --server)
- merge the archive to your freespace data folder
- First run $ festival, enter (voice.list), check that the output contains
cmu_us_awb_cg cmu_us_slt_cg
These are the voices used in this version. If they aren't there, the script needs editing to use your voices. They may differ by distro.

What I might add:
- Support for multiple voices / roles (already proof-of-concept with command)
- Parallel processing of long messages to improve performance, which is rather slow
- Packaging via Knossos

Currently, the only thing keeping this from running on any platform is the need to buffer the generated sound to disk. If the engine would allow playing a sound from a binary lua string, this would be easier.
There's a variable called rotten_portability_path in the script that needs to point to your <freespace>/data/voice/special folder.
All happens in memory now, no files needed

Please let me know if there's any interest in taking this further, if you need help using it, if you can think of improvements, ...

[attachment deleted by admin]

[attachment deleted by admin]

This is really exciting for me since I've pretty much ditched Windows entirely on my home PC.  I can play missions without VA, but I have to do a lot of pausing.

That said, I'm not the most savvy Linux user.  I used Unix back in the early 2000's in grad school, but that was totally different.  Given how many months it took me to figure out how to build Knossos locally, I'm probably going to be a bit of a trainwreck at testing this thing out at least at first.

But I'm going to give it my best shot!

EDIT: confirmed that I am not understanding exactly what I need to do to verify that the right voices are installed.  Tried running "voice.list" from inside festival, but all it seems to do is tell me that this is the list of installed voices without actually giving me any information on what those installed voices are.  I have figured out how to get Festival to run in server mode, but not how to do anything else.  Also I see that whatever attachments you provided have been deleted.  Were those important?

Uh yes that was the script. I don't know why they were deleted?

I do need to use the lua io api to write something to disk, is this a security issue?

I'll wait for the deleting admin to contact me before I share the script.

As for checking for the voices: you get that output when you enter

--- Code: ---voice.list
--- End code ---

By literally typing

--- Code: ---(voice.list)
--- End code ---
which is the Scheme/LISP way of calling the function voice.list, you can retrieve the list of installed voices.
For me on Arch it's

--- Code: ---(cmu_us_awb_cg cmu_us_rms_cg cmu_us_slt_cg)
--- End code ---
As I don't know which ones other distros package with festival,
you'll need to verify that these are present. There are numerous other voices
of various formats and qualities available, I haven't gotten around to installing and
testing them yet, and the procedure may vary between distributions.

Regarding your attachments, forum attachments are intended for temporary hosting, and are deleted every so often as the server space allocated to them fills up. You should host your files on a more permanent hosting platform such as Google Drive.

Ah, makes sense.
I'll put it up and post a link when I'm back at my PC


[0] Message Index

[#] Next page

Go to full version