Support for SAPI or another Text-to-Speech Program?

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
sake-bento
Eileen-Class Veteran
Posts: 1909
Joined: Sat Jan 26, 2008 5:58 pm
Completed: http://sakevisual.com/games.html
Projects: Every Sunrise, Shinsei
Organization: sakevisual
Tumblr: sakevisual
Deviantart: sakevisual
itch: sakevisual
Contact:

Support for SAPI or another Text-to-Speech Program?

#1 Post by sake-bento »

I've had a lot of requests from people to make my game more accessible for people who are blind, have poor vision, or trouble reading. My initial fix was to start making fully voiced games (including narration), but one person suggested integrating Ren'py with SAPI. That seems like a much better idea (plus it would make ALL Ren'py games accessible, not just mine). Is there any way to do this (or integrate it with some other text-to-speech program)?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Support for SAPI or another Text-to-Speech Program?

#2 Post by PyTom »

This was added to 6.18, which is still in prerelease.

See http://www.renpy.org/dev-doc/html/self_voicing.html . It works pretty well, but you may need to add the new "alt" attribute for things like imagemap buttons. I'd like feedback as to how well it integrates with voice - I suspect not well, but I'd like guidance as to how to fix it.

(I suspect a lot of these requests are from people who have tried the 6.18 prerelease.)
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
sake-bento
Eileen-Class Veteran
Posts: 1909
Joined: Sat Jan 26, 2008 5:58 pm
Completed: http://sakevisual.com/games.html
Projects: Every Sunrise, Shinsei
Organization: sakevisual
Tumblr: sakevisual
Deviantart: sakevisual
itch: sakevisual
Contact:

Re: Support for SAPI or another Text-to-Speech Program?

#3 Post by sake-bento »

Sweet! That's probably why people were talking about it. So does it read out no matter what, or does it stop reading if a voice file is attached to the line? Or is there a way to decide if it reads or not? For instance, if someone adds voices, but it's just reaction noises instead of the line, the player would still need the line read out to them.

I'll play around with it, now that I know it's here. Should be interesting.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Support for SAPI or another Text-to-Speech Program?

#4 Post by PyTom »

As of the current (that is, the next prerelease) 6.18, it reads only when there is not voice playing. Ren'Py will check that there's actually a voice playing - if it's finished, or muted out, keyboard events will cause Ren'Py to start reading again.

I think reaction noises properly belong on the sound channel, and not the voice channel - Ren'Py makes a bunch of assumptions that voice is meaningful. For example, Auto-forward delays until the voice stops playing.
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
sake-bento
Eileen-Class Veteran
Posts: 1909
Joined: Sat Jan 26, 2008 5:58 pm
Completed: http://sakevisual.com/games.html
Projects: Every Sunrise, Shinsei
Organization: sakevisual
Tumblr: sakevisual
Deviantart: sakevisual
itch: sakevisual
Contact:

Re: Support for SAPI or another Text-to-Speech Program?

#5 Post by sake-bento »

Cool. I'm working with it right now, and I like it so far. This is definitely something I'm going to upgrade my VNs to have. There was one point when the voice ended early, I think because I used quotes. The code was something like:

Code: Select all

"Is that what they call \"ramen noodles\" in this place?"
And she read "Is that what they call backslash ramen" and stopped there. Not sure if that's SAPI's parsing or Ren'py.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Support for SAPI or another Text-to-Speech Program?

#6 Post by PyTom »

I'll check it out on my end. It's probably the quote character.

Also, backslash ramen sounds like it should be a special menu item somewhere.
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
sake-bento
Eileen-Class Veteran
Posts: 1909
Joined: Sat Jan 26, 2008 5:58 pm
Completed: http://sakevisual.com/games.html
Projects: Every Sunrise, Shinsei
Organization: sakevisual
Tumblr: sakevisual
Deviantart: sakevisual
itch: sakevisual
Contact:

Re: Support for SAPI or another Text-to-Speech Program?

#7 Post by sake-bento »

Listing this here, since some of them are requests more than bugs, but here are a couple things for me:

-When a character is unvoiced, it would be nice to have the text-to-speech reader indicate who is speaking. Right now, narration and character lines are treated the same way, and it might get confusing. Having something like "Alice says..." before each spoken line might help to separate it from the narration.

-And speaking of such, maybe allowing a tag for the author to indicate exactly how a character is speaking would also work. For instance, I'd just print a line in italics to indicate Bob is thinking, but with the voiced version, it would be cool to have something like "Bob says..." and then allow the author to tag a line differently to be read as "Bob thinks..." This will hopefully be customizeable, as in Jisei when Aki "psychically projects her thoughts into your mind."

-The backslash quote thing is still breaking off after the first line. In Jisei this is getting awkward since all of the choices are in quotes. I can take the quotes out and cheat it, but it might still cut off some of the narration or spoken lines.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Support for SAPI or another Text-to-Speech Program?

#8 Post by PyTom »

I've addressed all of these in 6.18.0.634.

- When a character is unvoiced, the text of the name is read before the dialogue text. When the charater's name is an image, you can give the alt style property to that image.

- Providing what_alt to Character provides alt text for the dialogue. As of .634, this alt text can include [text], making it possible to do things like:

Code: Select all

define thought = Character(None, italic=True, what_alt="I thought: [text]")
- I believe I have fixed the problem with embedded quotes on Windows.
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
sake-bento
Eileen-Class Veteran
Posts: 1909
Joined: Sat Jan 26, 2008 5:58 pm
Completed: http://sakevisual.com/games.html
Projects: Every Sunrise, Shinsei
Organization: sakevisual
Tumblr: sakevisual
Deviantart: sakevisual
itch: sakevisual
Contact:

Re: Support for SAPI or another Text-to-Speech Program?

#9 Post by sake-bento »

Embedded quotes work now. Thank you! what_alt is also working beautifully.

Is there a way to make certain screen items read only if they are highlighted or hovered? I have a date box on my screen, and the reader is putting "Tuesday July 1" at the end of every sentence right now. I cheated it out by making the alt empty text, but I think if the player is stepping through items on the screen, the date should read out to them if they have selected the date box.

Post Reply

Who is online

Users browsing this forum: No registered users