Page 1 of 1

6.16: Automatic Voice + Translations

Posted: Thu Oct 24, 2013 5:15 pm
by xavimat
Me again, with my strange translation-related posts:

I've been playing with the new (6.16) feature Automatic Voice. The first thing I found is that the voice is only played the first time, if I return to the Main Menu and start again, it's not played.

I'm trying to use Automatic Voice with different translations, but I only have been able of figuring out this:

Code: Select all

init python:
    if _preferences.language is None:
        config.auto_voice = "voice/english/{id}.ogg"  # or simply: config.auto_voice = "voice/{id}.ogg"
    else:
        config.auto_voice = "voice/" + _preferences.language + "/{id}.ogg"
But it needs the user to restart the game every time the Language is changed, otherwise, the former language is played, while the text in the new language is displayed.

Also, the "Extract Dialogue" feature doesn't consider the translated script.
It could be possible to have different "dialogue identifiers" according to the translations?:
> Language = None; id = start_a170b500
> Language = "spanish"; id = start_a170b500_spanish

Re: 6.16: Automatic Voice + Translations

Posted: Thu Oct 24, 2013 9:41 pm
by PyTom
xavimat wrote:I've been playing with the new (6.16) feature Automatic Voice. The first thing I found is that the voice is only played the first time, if I return to the Main Menu and start again, it's not played.
Could you put together a replication for me? This shouldn't happen.
I'm trying to use Automatic Voice with different translations...
I've modified Ren'Py so that auto_voice can be a function instead of a string. The function can access all sorts of things, including _preferences.language. So you should be able to do what you want.

Re: 6.16: Automatic Voice + Translations

Posted: Fri Oct 25, 2013 5:51 am
by xavimat
PyTom wrote:
xavimat wrote:I've been playing with the new (6.16) feature Automatic Voice. The first thing I found is that the voice is only played the first time, if I return to the Main Menu and start again, it's not played.
Could you put together a replication for me? This shouldn't happen.
My little test (sorry about my pronunciation :oops: )
voice_test.zip
(209.98 KiB) Downloaded 42 times

Re: 6.16: Automatic Voice + Translations

Posted: Fri Oct 25, 2013 10:58 pm
by PyTom
Thanks for the replication. Having that made it easy to fix the underlying bug.

Re: 6.16: Automatic Voice + Translations

Posted: Sat Oct 26, 2013 3:13 am
by xavimat
Glad to help! :)

Re: 6.16: Automatic Voice + Translations

Posted: Mon Oct 28, 2013 10:55 am
by xavimat
Tested in 6.16.0.335 and both things work.
I've used this code for auto_voice:

Code: Select all

init python:
    def the_voice(identifier):        
        if _preferences.language is None:
            return "voice/english/" + identifier + ".ogg"            
        else:
            return "voice/" + _preferences.language + "/" + identifier + ".ogg"            
    config.auto_voice = the_voice
On the other hand, there is a small error in the documentation of auto_voice ( http://www.renpy.org/dev-doc/html/voice ... atic-voice ), the variable config.auto_dialogue should be config.auto_voice.

About the translations, I've seen also the new feature: "translate None strings:" It's wonderful for us who write the original text in non-English language. Thanks!

Re: 6.16: Automatic Voice + Translations

Posted: Mon Oct 28, 2013 11:00 am
by PyTom
I've fixed that, thanks for pointing it out.

Translate None strings is actually an old (6.15 series) feature, as it existed in 6.15, but wasn't documented. (I actually went in to implement the feature for 6.16, only to realize it was already there.)