Preventing Self-Voicing from Activating

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Silence in Space
Regular
Posts: 31
Joined: Tue Nov 22, 2016 4:48 pm
Projects: Silence in Space
Contact:

Preventing Self-Voicing from Activating

#1 Post by Silence in Space »

I have found that the self-voicing feature that is included with the keybindings to be annoying. Sure, I can simply remove it from the Help section on the Main Menu; however, this does not prevent the user from hitting "V" on the keyboard and activating it accidentally. I want to know how to prevent it from activating. I do not mind if the dialogue prompt appears in the upper left hand corner. I simply want the self-voicing feature to not work or be completely muted.

I have been reading that it is apparently dependent upon the operating system instead of the Ren'Py engine. This means that there is something in Ren'Py that asks the operating for this synthesized voice. I have done the following in option.rpy:

Code: Select all

define config.has_voice = False
The self-voicing completely destroys the atmosphere and mood of the game that I am creating and therefore must be removed entirely; however, there is nothing that I can find in screen.rpy, option.rpy, and gui.rpy that dictates self-voicing. Can I just have "V" as an empty keybinding (i.e. part of the keyboard configuration but does not have any real function or effect)?

I can easily hide the fact that "V" does anything it is simply my fear that the user will accidentally discover this for him or herself.

If this is not possible without tearing apart the Ren'Py engine, is there a way that I can change the default self-voicing voice synthesizer to something very distorted?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Preventing Self-Voicing from Activating

#2 Post by Imperf3kt »

Take a look in 00common.rpy in your ren'py install folder and you can copy the self voicing code from there, into your project (screens.rpy is appropriate) and then edit it to disallow self voicing.

Disclaimer:
I may have the wrong file, going by memory. It is definitely in one of the 00*.rpy files though.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Preventing Self-Voicing from Activating

#3 Post by Remix »

Code: Select all

define preferences.self_voicing = False
init python:
    del config.keymap['self_voicing']
untested
Frameworks & Scriptlets:

User avatar
Silence in Space
Regular
Posts: 31
Joined: Tue Nov 22, 2016 4:48 pm
Projects: Silence in Space
Contact:

Re: Preventing Self-Voicing from Activating

#4 Post by Silence in Space »

Remix wrote: Sun Oct 22, 2017 8:49 pm

Code: Select all

define preferences.self_voicing = False
init python:
    del config.keymap['self_voicing']
untested
I get the following error message:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/options.rpy", line 97, in script
    define preferences.self_voicing = False
  File "renpy/common/000namespaces.rpy", line 26, in set
    raise Exception("The define statement can not be used with the preferences namespace.")
Exception: The define statement can not be used with the preferences namespace.
I don't think I've seen the error message stated in this format before. That's interesting. I recognize namespace from C++ from my classes in college but that is simply it. I am not sure if namespace is used differently in Python (or Ren'Py).

User avatar
Silence in Space
Regular
Posts: 31
Joined: Tue Nov 22, 2016 4:48 pm
Projects: Silence in Space
Contact:

Re: Preventing Self-Voicing from Activating

#5 Post by Silence in Space »

Imperf3kt wrote: Sun Oct 22, 2017 8:39 pm Take a look in 00common.rpy in your ren'py install folder and you can copy the self voicing code from there, into your project (screens.rpy is appropriate) and then edit it to disallow self voicing.

Disclaimer:
I may have the wrong file, going by memory. It is definitely in one of the 00*.rpy files though.
There is no 00common.rpy file present in the game's folder. It may be helpful to mention that I am making this game on the Mac (i.e. an Apple computer) using the New GUI (not the Legacy).

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Preventing Self-Voicing from Activating

#6 Post by Remix »

Oops..
Preference variables store the values of Ren'Py preferences. While the value of a preference should be set at runtime using the Preference() action, preference variables should be used in conjuction with the default statement to set the default value of a preference.

For example:

default preferences.text_cps = 142
So, ummm

default preferences.self_voicing = False
Frameworks & Scriptlets:

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Preventing Self-Voicing from Activating

#7 Post by Imperf3kt »

Silence in Space wrote: Mon Oct 23, 2017 7:16 pm
Imperf3kt wrote: Sun Oct 22, 2017 8:39 pm Take a look in 00common.rpy in your ren'py install folder and you can copy the self voicing code from there, into your project (screens.rpy is appropriate) and then edit it to disallow self voicing.

Disclaimer:
I may have the wrong file, going by memory. It is definitely in one of the 00*.rpy files though.
There is no 00common.rpy file present in the game's folder. It may be helpful to mention that I am making this game on the Mac (i.e. an Apple computer) using the New GUI (not the Legacy).
Of course not, all 00 prefixed files are found in renpy install folder.
I don't know how it works on a mac, but on Windows that would be C:\program files(x86)\renpy
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Preventing Self-Voicing from Activating

#8 Post by Divona »

Code: Select all

init python:
    config.keymap['self_voicing'].remove('v')
    config.keymap['self_voicing'].remove('V')
Completed:
Image

edgebug
Regular
Posts: 41
Joined: Thu Jun 30, 2016 11:44 pm
Contact:

Re: Preventing Self-Voicing from Activating

#9 Post by edgebug »

Why do you want to make your game inaccessible to blind folks, though...? O_o

I mean, I get that to a sighted person, the self-voicing might change the atmosphere, but consider: it's easy to just hit V again to turn it off if they accidentally turn it on, and also, without the voicing, a person with limited or no vision won't be able to get any atmosphere from the game at all.

IDK, I just think you should maybe rethink making the game deliberately inaccessible to an entire demographic of disabled folks. :D

User avatar
Silence in Space
Regular
Posts: 31
Joined: Tue Nov 22, 2016 4:48 pm
Projects: Silence in Space
Contact:

Re: Preventing Self-Voicing from Activating

#10 Post by Silence in Space »

edgebug wrote: Tue Oct 24, 2017 5:19 am Why do you want to make your game inaccessible to blind folks, though...? O_o

I mean, I get that to a sighted person, the self-voicing might change the atmosphere, but consider: it's easy to just hit V again to turn it off if they accidentally turn it on, and also, without the voicing, a person with limited or no vision won't be able to get any atmosphere from the game at all.

IDK, I just think you should maybe rethink making the game deliberately inaccessible to an entire demographic of disabled folks. :D
I have already released this and therefore am leaving the self-voicing implemented into the game and let the computer generate it (although something within the game's dialogues may cause the text-to-speech AI mispronounce some fictitious words). Sure, I can do the voice acting myself but the point of the game is to immerse yourself as the main character (whose gender is purposely made ambiguous).

I am simply curious if there is a way to actually properly disable self-voicing since it seems like a forced implementation in the engine that cannot be turned off by simply setting a value to true. If I read other forums correctly, apparently self-voicing was only "recently" added to Ren'Py.

I am not trying to bar people who are unable to see or have difficulty seeing from being able to enjoy the game. I am simply wanting to implement a self-voicing of my own selection and not the garbage synthetic voices found on current computers (for English at least).

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Preventing Self-Voicing from Activating

#11 Post by PyTom »

Self-voicing is an accessibility thing. Because I want it to be turned on by people who can't see, I had to bind it to as simple a key as possible. That makes it difficult to turn off, since it's fairly deeply integrated.

If you want to do your own voicing, you can - self-voicing won't occur when a voice is playing on the voice channel.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Preventing Self-Voicing from Activating

#12 Post by Imperf3kt »

PyTom wrote: Fri Nov 03, 2017 8:27 pm Self-voicing is an accessibility thing. Because I want it to be turned on by people who can't see, I had to bind it to as simple a key as possible. That makes it difficult to turn off, since it's fairly deeply integrated.

If you want to do your own voicing, you can - self-voicing won't occur when a voice is playing on the voice channel.
So if someone used a silent voice file, you could override it?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

sonejo
Newbie
Posts: 20
Joined: Thu Jun 30, 2016 4:00 pm
Contact:

Re: Preventing Self-Voicing from Activating

#13 Post by sonejo »

This worked for me:

Code: Select all

define config.keymap['self_voicing'] = []
define config.keymap['clipboard_voicing'] = []

User avatar
JenivereDomino
Regular
Posts: 27
Joined: Tue Nov 17, 2020 4:14 pm
Completed: Summer Horrordays
Projects: "Project Cadence" (Placeholder)
Organization: PunderBash Games
Deviantart: JenivereDomino
Github: JenivereSH
itch: punderbashgames
Location: United Kingdom
Discord: Jenivere #1227
Contact:

Re: Preventing Self-Voicing from Activating

#14 Post by JenivereDomino »

This topic is old, but a blind friend of mine wanted me to pass on this comment regarding the assisted voicing feature, as he came across this topic when looking into how well the feature would work for him playing VN games:

"Here is the thing. The "garbage" voice they speak of? That *could be* one of the voices that blind people use on their PCs every day. It is a speech synthesizer, and it is something that people in the blind community are used to. The thing that makes a character ambiguous, or designed to be "you" as the main character, the synthesizer fulfills that because to a blind person, a speech synth is a "voice", not a "character". It's a narrator by default. Hearing a "voice" does not mean hearing a "character". The voice *is* how blind people use their computers. We actually have several voices at our disposal."

I hope this helps anyone else who is having trouble deciding about whether to try and disable self-voicing. Even with pronouncing fictitious words and names, there's no guarantee that a reader will be pronouncing them correctly in their mind anyway as they read, but if you're particularly concerned you could probably use square brackets with a condition that would change the spelling to something phonetic that the AI would pronounce as you intend it to when the self-voicing option is turned on.
Mighty Morphine Vowel Arranger

User avatar
papillon
Arbiter of the Internets
Posts: 4107
Joined: Tue Aug 26, 2003 4:37 am
Completed: lots; see website!
Projects: something mysterious involving yuri, usually
Organization: Hanako Games
Tumblr: hanakogames
Contact:

Re: Preventing Self-Voicing from Activating

#15 Post by papillon »

Unfortunately there's now a new reason to attempt to disable self-voicing: Steam is apparently marking games as "Unsupported" on Deck if they contain self-voicing.

EDIT: Okay, they agreed with me that it seemed silly to mark the game as totally unplayable because an optional accessibility feature doesn't work. Phew!

Post Reply

Who is online

Users browsing this forum: No registered users