Quick question for Apple & Linux (not Android) Renpy code gurus r.e. self-voicing...

OhWee

Forum Fanatic
Modder
Game Developer
Jun 17, 2017
5,685
28,710
OK, thanks to my cat stepping on my keyboard, I discovered that, while playing a Renpy game, if you press v, this enables (or disables if enabled) self-voicing, where your computer will read the Renpy text to you over your speakers in a male voice...

After freaking out (wtf?) and then googling this, I did some googling and discovered that, for Windows 10 users at least, you can change the 'default' voice to 'Zira' which is a feminine computer voice.

For those Windows 10 that might care, open the /lib folder in your Renpy game, and navigate to windows-x86-64, and/or windows-i686 and look for the file say.vbs.

Open this up with notepad+ or a similar program, and comment out line 2 by adding an asterisk to the beginning of the lne, i.e. like this:
*Speaker = WScript.Arguments(1)

This is so that you can change it back if needed later
Then add this line immediately below:
Speaker = "Zira"

Then, start up your Renpy game and press v, and you should have a female computer voice instead of the male one. Yeah, it's a dry voice, but at least now it's a woman talking and not a man...

Anyways, my question is to Android and Mac user types that are up to speed on this Renpy function. How would you manually designate a female voice (and which one do you prefer), i.e. which file would you edit and how should the edit be coded?

On a slightly related note, has anyone figured out an easy way to toggle the self-voicing on and off in a Renpy script? Say if you want a computer voice to talk to the player/read the dialogue text, but don't want to have to record and trigger a sound file...
 

LightmanP

Well-Known Member
Modder
Game Developer
Oct 5, 2020
1,660
15,336
OK, thanks to my cat stepping on my keyboard, I discovered that, while playing a Renpy game, if you press v, this enables (or disables if enabled) self-voicing, where your computer will read the Renpy text to you over your speakers in a male voice...

After freaking out (wtf?) and then googling this, I did some googling and discovered that, for Windows 10 users at least, you can change the 'default' voice to 'Zira' which is a feminine computer voice.

For those Windows 10 that might care, open the /lib folder in your Renpy game, and navigate to windows-x86-64, and/or windows-i686 and look for the file say.vbs.

Open this up with notepad+ or a similar program, and comment out line 2 by adding an asterisk to the beginning of the lne, i.e. like this:
*Speaker = WScript.Arguments(1)

This is so that you can change it back if needed later
Then add this line immediately below:
Speaker = "Zira"

Then, start up your Renpy game and press v, and you should have a female computer voice instead of the male one. Yeah, it's a dry voice, but at least now it's a woman talking and not a man...

Anyways, my question is to Android and Mac user types that are up to speed on this Renpy function. How would you manually designate a female voice (and which one do you prefer), i.e. which file would you edit and how should the edit be coded?

On a slightly related note, has anyone figured out an easy way to toggle the self-voicing on and off in a Renpy script? Say if you want a computer voice to talk to the player/read the dialogue text, but don't want to have to record and trigger a sound file...
It's not supported on Android and for the default voice, you can check .
 

OhWee

Forum Fanatic
Modder
Game Developer
Jun 17, 2017
5,685
28,710
LightmanP

That doesn't answer my other question, r.e. which female voice would you recommend?

Here's the relevant code snippet from the docs page. Renpy docs are often written for 'power users' and not newbies, but I understand where to put init python at least...

For others that may be wondering:

Code:
init python:

    if renpy.windows:
        config.tts_voice = "Mark"
    elif renpy.macintosh:
        config.tts_voice = "Alex"
    elif renpy.linux:
        config.tts_voice = "english_rp"
This should allow you to not need to edit say.vbs in the lib windows folders of course.

Good to know that Android doesn't support this. I also meant say Linux probably...
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,266
15,082
On a slightly related note, has anyone figured out an easy way to toggle the self-voicing on and off in a Renpy script?
The easiest (and compatibility safest) way is $ Preference("self voicing", "enable")()


Say if you want a computer voice to talk to the player/read the dialogue text, but don't want to have to record and trigger a sound file...
It will still works as the self voicing do. The feature isn't designed to voice your game, but to help visually impaired people to play the game. Therefore it will read everything on the screen, including the interface.



That doesn't answer my other question, r.e. which female voice would you recommend?
I highly recommend one that:
  1. Handle English speech
  2. Is present on the player computer.
And the fact is that you have no real guaranty that a voice will be present or not. By example, you wrote about replacing the default voice by Zira, well, glad because in my computer it's the only available voice for English.

What mean that the best way to do is to firstly check what are the available voices ; and if "espeak" is installed since it don't necessarily come by default. Then only you can decide which one you'll use, or let the player decide which one he want to use.

Code:
    import subprocess

    def availableSpeakers():
        store.sayers = []

        if renpy.windows:
            tmpList = subprocess.check_output( [ "cscript", renpy.exports.fsencode( renpy.os.path.join(config.gamedir, "sayer.vbs") ) ] ).split( "\n" )

            for atom in tmpList:
                n = re.match( "^Microsoft (.*) - English.*", atom )
                if n is None: continue
                store.sayers.append( n.group(1) )

        elif renpy.linux:
            tmpList = subprocess.check_output( [ "espeak", "--voices=English" ] ).split( "\n" )

            for atom in tmpList:
                [...]

        elif renpy.macintosh:
            tmpList = subprocess.check_output( [ "say", "-v" ] ).split( "\n" )

            for atom in tmpList:
                [...]
I let peoples tell you what are the format for both espeak --voices and say -v, since I don't know them.

As for "sayer.vbs" it's this:
Code:
Set s = CreateObject("SAPI.SpVoice")
Set fso = CreateObject ("Scripting.FileSystemObject")
Set stdout = fso.GetStandardStream(1)

For Each Voice In s.GetVoices
    stdout.WriteLine Voice.GetDescription
Next
 

Ok-Dick

New Member
May 29, 2020
12
41
Hey guys.
I came across a bit of an issue regarding the self-voicing tool in RenP'y.
Ever since I've started playing these VNs, I've used this tool for convenience purposes. How ever, recently, the games refuse to voice any text. No error pops up, the game seems to register the text as "being read" (an hourglass appears next to the mouse when ever it hovers over something), but no text is heard.
Could it be my computer or something else?
Any advice would be very much appreciated.
Thanx and sorry for the inconvenience.
 

weeday420

New Member
Mar 13, 2021
2
2
OK, thanks to my cat stepping on my keyboard, I discovered that, while playing a Renpy game, if you press v, this enables (or disables if enabled) self-voicing, where your computer will read the Renpy text to you over your speakers in a male voice...

After freaking out (wtf?) and then googling this, I did some googling and discovered that, for Windows 10 users at least, you can change the 'default' voice to 'Zira' which is a feminine computer voice.

For those Windows 10 that might care, open the /lib folder in your Renpy game, and navigate to windows-x86-64, and/or windows-i686 and look for the file say.vbs.

Open this up with notepad+ or a similar program, and comment out line 2 by adding an asterisk to the beginning of the lne, i.e. like this:
*Speaker = WScript.Arguments(1)

This is so that you can change it back if needed later
Then add this line immediately below:
Speaker = "Zira"

Then, start up your Renpy game and press v, and you should have a female computer voice instead of the male one. Yeah, it's a dry voice, but at least now it's a woman talking and not a man...

Anyways, my question is to Android and Mac user types that are up to speed on this Renpy function. How would you manually designate a female voice (and which one do you prefer), i.e. which file would you edit and how should the edit be coded?

On a slightly related note, has anyone figured out an easy way to toggle the self-voicing on and off in a Renpy script? Say if you want a computer voice to talk to the player/read the dialogue text, but don't want to have to record and trigger a sound file...
thx for this was tired of having bro in my ear lmao