[Idea] Using TTS Engine for Betty

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

[Idea] Using TTS Engine for Betty

Post by UniTrader »

ok, i have been Mapping a bit last Weekend (my first Modding for a few months - finally got in the mood again :) ) and thought it would be nice to voice the new Sectors and Zones, but hiring the original Voice Actress for a few words is out of the question and since only the Boardcomp needs to be re-done for many purposes i thought it is pretty realistic to try using a TTS Engine. did a few tests with espeak. did a few more. automated the process a bit. half an hour later all voice recordings were done(~130MB).
I know it sounds not as good as the original recordings, but there is much space for improvement.
Additionally everyone can easily add Text for Betty with this and the Boardcomputer has one consistent Voice only, regardless of what is said.
now i wonder if there is demand for such a Mod

Additionally i am open here for suggestions to other Free TTS Engines which are scriptable because i am not really familiar with the Engines available out there
Last edited by UniTrader on Tue, 24. Jun 14, 21:14, edited 2 times in total.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
Earth Ultimatum IV.
Posts: 5280
Joined: Mon, 3. May 10, 14:39
x4

Post by Earth Ultimatum IV. »

That would be nice.
Just make sure that it doesn't end up like ArmA II's voices.
Ginger470
Posts: 158
Joined: Sun, 20. Jun 04, 03:24
x2

Post by Ginger470 »

OpenMary is a TTS I've used on projects ... it's pretty useful, but I must admit I don't know off the top of my head how you'd set up the tunnel through from X to Mary. Plus it's all open source :)
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

well, i didnt set up any tunnel, i just parsed the t-files via xsl in a bash script which generated the ogg files in the folder structure used by the game ^^ as long as the tts engine is scriptable any does (and since your suggested is open souce i am pretty sure it does - will look into it when at home)

and sorry about the not really goot examples, but didnt put that much effort into it (was done in around 5 minutes :D) - more busy with mapping currently, since thats atm my primary project :)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
Observe
Posts: 5341
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe »

Great work UniTrader! :)
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

just stumpled across another TTS engine, pico2wave which sounds pretty fitting, here an example - i think that one will do the trick :)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
Observe
Posts: 5341
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe »

Actually, I preferred the TTS synthesis with your first example/s. Pico2wave seems more distorted and less pleasant imo.
Eriodas
Posts: 267
Joined: Thu, 23. Dec 10, 06:36
x4

Post by Eriodas »

The sound quality of the first examples is a lot better, but they seem to be read by a bored computer with reading difficulties.

I have never used that kind of software, but if someone can configure or calibrate the sound enough to get closer to betty's feeling on X3... i would be very happy.

Once the voice is done, we can think of getting sounds for anything in the game.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

well, which voice doesnt matter because my approach is not to distribute the completed voices, but a compilation of the TTS Engine(s) and Script files so everyone can generate the Voices himself and adjust the Settings to his preference ;) to make fine-tuning for each TTS-Engine possible i thought about adding Attributes to the t-file entry (i already know how to get them into the vanilla t-files if necesary before generating ;) ) - if there is one for the wanted engine it is used, otherwise the Text used by the Game is spoken like:

<t id="1" espeak=" --stdout -s 160 -v en+f5 'BeAlSiO'" >Bealsio</t>

this way pico2wave would use the default Settings and espeak would speak a slightly changed variant. additionally i thought about adding an enc(oder) attribute, if someone wants to change the Encoding or add some post-processing per entry. This approach maximizes flexibility for everyone and significantly reduces the DL size, although it requires one additional user action per extension but that should not be a problem i think ^^
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Could you replace the sound file for 'Auto-pilot engaged' to 'Auto-pilot confused' too please? ;)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Interesting...

Out of curiosity do you know if there is anyway to communicate with an external program in X-rebirth?

(e.g. X3 had logfiles and t files, not the best but it worked)
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

You can output to the debug.log in documents/egosoft/... and have a listener program watching that. I used it to dump galaxy market data snapshots to sqlite db. Now adding lua/xpl is possible there may be a more flexible method from that too.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Hmm.. On a side note, I was going to offer to write a c# program to do TTS stuff, I was going to do it on the weekend but it seemed unusually easy to make

Assembly System.Speech (.net > 4 I believe)

(Note this uses the windows voice synth stuff)

var reader = new SpeechSynthesizer();
var path = @"C:\test\file.wav";
var dir = Path.GetDirectoryName(path);
Directory.CreateDirectory(dir);
reader.SetOutputToWaveFile(path);
reader.SpeakAsync("test text");



I'll spend a bit of time over the weekend to read a t-file and create the files


I'll probably do something like:

-Release program that reads basic tfile, and outputs file (I'll need to research what naming conventions the file should use)
-Save basic settings (remember files/folders)
-Add more options for the TTS (e.g. voice options, encoding options)
-More settings, profiles
-Ability to read cat/dats, and multiple tfiles and cross references {PageId,TextId}
-TTS Implementation supposedly has memory leak (40~megabytes after an hour of continuous speaking), create new implementation

Any other features/requests?





-----
Things to research:
-How to read tfiles (I hope it hasn't changed since X2/X3
-File naming convention
-Sound file requirements (encoding?)
-Reading cat/dats (I've seen source for this but I have not looked for some time)
-TTS enginge's other nifty featurs
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

s9ilent wrote:-How to read tfiles (I hope it hasn't changed since X2/X3
its exactly the same like in X3TC ;)
s9ilent wrote:-File naming convention
For normal Speak:
$File.path.name = 'voice-L0' + $langID + '/' + $PageID + '/normal/' + $textID + '.ogg'
For comm Speak (slightly distorted; does not apply to Betty):
$File.path.name = 'voice-L0' + $langID + '/' + $PageID + '/comm/' + $textID + '.ogg'
additionally there is also an lipsync folder with xpm files or something inside, but dont ask me how this one works..
s9ilent wrote:-Sound file requirements (encoding?)
ogg/vorbis ;)
s9ilent wrote:-Reading cat/dats (I've seen source for this but I have not looked for some time)
slightly diffrent from TC,if you want i can give you an explaination about their structure (pretty simple stuff ^^)

btw: i think its best when the TTS solution can do both: speaking a Text its not necesary to change half the game and still have the on-demand capability


PS i think i will concentrate on my Mapping Project and leave this one to s9ilent - maybe i will release the bash scripts when it works completely automatically but no port to windows - sry
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Return to “X Rebirth - Scripts and Modding”