More on Voice support....

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
alshapton
Regular
Posts: 49
Joined: Tue Oct 24, 2006 5:32 pm
Location: Wales
Contact:

More on Voice support....

#1 Post by alshapton » Tue Dec 19, 2006 4:08 am

I have a game where there is a voice dialog. I am using "say "whatever"" to present the dialog to the user in text form. Each line of dialog has a wav file which I am "voice-ing" along with it.

the problem is that the user can skip to the next dialog before the sound has finished. I need that not to happen i.e. the interaction to skip should only be available after the sound has finished playing.

You may say that this not the way for VN type games, but this is an educational game for small children, so the correlation between sound and text is important to reinforce the learning process.

Strange usage of Ren'Py - educational games for children, but its a great tool for what I need to produce !

Thanks for help in advance.,......

Andrew

User avatar
Mirielle
Regular
Posts: 130
Joined: Thu Nov 02, 2006 5:05 am
Deviantart: miirne
Soundcloud: mirne-1
Contact:

#2 Post by Mirielle » Tue Dec 19, 2006 4:50 am

Well, I too am a complete amatuer in the progamming side of Ren'Py, I can barely get things to work for me...but!

One word of advice. Wav files can get really, really space and memory consuming. Mp3's & Ogg's are probably the way to go. If you need a converter if you've already got the voicing then I suggest Audacity.

It's free!

But that's beside the point.

I'm sure Py'Tom or some other skilled Ren'Py prgrammer will stumble along this and actually give real advice. Ignore me.
Available for voice acting - Please listen to my demo reel!

zen
Newbie
Posts: 16
Joined: Thu Dec 01, 2005 5:00 pm
Contact:

#3 Post by zen » Tue Dec 19, 2006 7:42 pm

The clue is found in the voice.rpy file tucked away in the common directory:

Normally, a voice is cancelled at the start of the next
# interaction. If you want a voice to span interactions, call
# voice_sustain.
#
# voice "e_1002.ogg"
# e "Voice sustain is a technique that allows the same voice file.."
#
# $ voice_sustain()
# e "...to play for two lines of dialogue."

This sustains the voice and gets you to the next line of dialog. You can try using renpy.pause(10.0) to delay them 10 seconds before proceeding. Another way to handle is when a user clicks to cut off voice then jump them to a menu to determine if they really want to move on or loop them back to continue. Meanwhile, sustain the voice while they choose to continue or quit.

Here is the way I handle it when i want to be sure they are ready to move off a bit of long dialog. More experienced coders probably can suggest a more elegant way.

------------------start example -----------------------

label lesson1:

voice "lesson1.wav"

e "Listen carefully now, and learn your lesson!
Do not click to advance until you have learned the lesson."

$ voice_sustain()

label lesson_menu1:

$ voice_sustain()

menu:

"Continue listening.":

$ voice_sustain()

"Teacher frowns but continues talking."

jump lesson_menu1

"Request permission to leave early.":

$ voice_sustain()

e "Are you sure you have heard enough?. If you click again, you will be dismissed"

return

"The lesson is over, may I be dismissed?":

e "only if you can tell me the last words I said. What were they?"

menu answer1_menu:

"blah blah":

e "WRONG!, You will get extra lessons for lying!"

return

"la la":

e "Very good!"

return

"ZZzzzzz":

e "WRONG!, You will get extra lessons for lying!"

return

label post_lesson1:

e "You are dismissed.

return

-------------------------end example--------------------

Hope this helps!

User avatar
PyTom
Ren'Py Creator
Posts: 15437
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:

#4 Post by PyTom » Tue Dec 19, 2006 9:26 pm

Hm... I think I'd have to change Ren'Py to support this, as right now the ability to dismiss a screen immediately is hard-coded in. I'll take a look at changing that, but it probably won't be out until at least the next release or so.

I'm interested in what you're doing with Ren'Py as a tool for educational games. I think it does have promise in that field, so I'll do what I can to support you.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users