Multilingual dubbing?

Started by Chomba, Wed 15/09/2021 19:25:46

Previous topic - Next topic

Chomba

Hello again!
I have a question. I'm currently making the voices for my game and I'm wondering if it's possible to make a dubbing in different languages (that can be changed from a menu in the game like the translations of the texts). And if so, how would it be handled? I couldn't find anything specifically about this in the manual... maybe I didn't know how to look for this either.

Khris

IIRC this is not natively supported, but you basically need to create a second speech.vox file (by replacing all recorded speech files with the new language ones, then building the game files again).
Then you simply offer the two speech.vox files as separate downloads, to be moved into the game folder.

Chomba

Ohh, I see...

Thanks for responding, Khris!

Crimson Wizard

#3
There are three potential approaches available today.

1. Use separate speech.voxes, which user has to download and place into game folder by hand (or maybe some kind of installer can do that), as Khris suggested.
2. Assign different language a different set of voice numbers, each language having some numeric offset.
3. Use dummy invisible characters to do the talking in different languages: they will have different voice filenames but same numbers.
EDIT: variant 3b. Since AGS 3.5.0 there's "Game.PlayVoiceClip" that allows to specify which "person's" voice clip to play, may be useful for custom speech.



Regarding p2 I would not do that without some tool though. Idk if such tool exists (can Speech Center do that?). As an example of a simplier tool, it could be a script (e.g. in Python or similar scripting language) that parses the original lines in TRS, and makes sure that their translation has (voice number + N) set, where N is some offset. Similar tool or script could name the voice files for the different language accordingly.
Such approach of course has danger of running out of voice numbers, as IIRC they are still limited to 9999 per character. EDIT: speech numbers no longer limited since 3.5.0.

p3 may be also used as a workaround when you run out the voice limit for a character.


PS. A while ago I've been wondering about what's required for supporting multiple voice files, and I think maybe not a lot; here's a related ticket:
https://github.com/adventuregamestudio/ags/issues/686

Crimson Wizard

Wanted to bump this, to note that there's a multi-VOX solution coming into AGS 3.6.0 soon (at the time of writing this), where editor supports building several speech voxes using subfolders inside a Speech folder, and engine can switch between multiple speech voxes freely using new script command.

Cassiebsg

That sounds awesome!  (nod)
Thanks for all the hard work!
There are those who believe that life here began out there...

arj0n


Chomba

That's amazing!!


In the meantime, I think I found a way to do it differently. I don't know how feasible it is for a large project, but it works like this (may be useful for older versions):

Let's say we have a line of dialog.

Code: ags
cRoger.Say ("&1 There's a snake in my boot!"); 


already numbered for the speech and we have two audios for it, one in English and one in Spanish.

So what we do is generate two translation files. 1: "English voice with English text" and 2: "Spanish voice with English text".

We will name the English audio as ROGE1 and the Spanish one as a variant that we will never get to, as ROGE1000001 (there has to be a number before the 0, otherwise it will read it as just the number 1).

then we go to the translation file 1 and "translate" it like this:

&1 There's a snake in my boot!
&1 There's a snake in my boot!

this will play the English audio when we see that dialogue in English.

Then, if we go to translation file 2 and put the following translation:

&1 There's a snake in my boot!
&1000001 There's a snake in my boot!

we will see the text also in English, but with a Spanish dub :D.

Please note that we number 1 and 1000001 (the next one would be 2 and 1000002) in order to be able to easily replace the numbers when editing the texts and not to complicate the naming of the audio files.

It's a lot of hard work, but it would be a way to do it (I tried it and it works).

What do you think about it?

Crimson Wizard

#8
Quote from: Chomba on Sat 27/11/2021 23:12:25
We will name the English audio as ROGE1 and the Spanish one as a variant that we will never get to, as ROGE1000001 (there has to be a number before the 0, otherwise it will read it as just the number 1).

Yes, I believe this might work (this is the variant 2 i mentioned in the post above).
Note that this may be automated to save a huge amount of time by writing e.g. a Python script, as mentioned in my comment too.

On a side note, i only recently noticed that numbers over 9999 are available since AGS 3.5.0 (this limit got fixed by some unrelated change).



Chomba

#9
QuoteYes, I believe this might work (this is the variant 2 i mentioned in the post above).
Oh, snap! It's true! I´m sorry, I didn't quite understand it at the time!

QuoteNote that this may be automated to save a huge amount of time by writing e.g. a Python script, as mentioned in my comment too.

Yes, here:

QuoteRegarding p2 I would not do that without some tool though. Idk if such tool exists (can Speech Center do that?). As an example of a simplier tool, it could be a script (e.g. in Python or similar scripting language) that parses the original lines in TRS, and makes sure that their translation has (voice number + N) set, where N is some offset. Similar tool or script could name the voice files for the different language accordingly.

I think one way to make the change (rough, but it would be a way) would be inside AGS itself, generate an empty script and paste all the text from your translation file.

You use the replace text tool and put:

Replace: &
with: &100000
(edit: you should delete the zeros where appropriate)

then you give it to skip one (the original line) and replace another (the dubbing line) successively until the end. After that you copy the ags into your translation document and you are ready to go.

This is a way of doing it "by hand" and making a control of it at the same time... I can't think how to automate it (I have no coding knowledge).

QuoteOn a side note, i only recently noticed that numbers over 9999 are available since AGS 3.5.0 (this limit got fixed by some unrelated change).
Lucky me! XD

Crimson Wizard

#10
Quote from: Chomba on Sat 27/11/2021 23:46:10
I think one way to make the change (rough, but it would be a way) would be inside AGS itself, generate an empty script and paste all the text from your translation file.

You use the replace text tool and put:

Replace: &
with: &100000

Well, you do not need to copy anything into AGS, the text editor you're using to work with translation files can do same.

Quote from: Chomba on Sat 27/11/2021 23:46:10
This is a way of doing it "by hand" and making a control of it at the same time... I can't think how to automate it (I have no coding knowledge).

You could ask someone who knows e.g. Python, this must be a trivial thing to script a for loop that skips odd lines and replaces text pattern; and you no longer will have to do this by hand.

I.e.:
- for each odd line
-- if starts with "&"
--- parse "number" after the "&"
--- write next (even line) as ("&" + "number + 1000000" + "text")
-- else
--- write empty line next


SMF spam blocked by CleanTalk