[SOLVED] Voice playback bug? Or perhaps something else...

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
Shocking Alberto
Newbie
Posts: 12
Joined: Sun Mar 29, 2020 4:58 am
Contact:

[SOLVED] Voice playback bug? Or perhaps something else...

#1 Post by Shocking Alberto » Sun Mar 29, 2020 5:11 am

I have a question about voice playback in Ren'Py.

There is a situation in a game I'm debugging where the voice is to be timed to some degree with the corresponding text.

For example:

Code: Select all

voice "voice/v0001.ogg"
??? "Yo-u-ta! I came to hang out."
So the intent here is for "Yo-u-ta!" to display then stop, until the second part of the voice clip which has the rest of the dialog. I figure simply adding a wait would be all that's necessary.

Code: Select all

voice "voice/v0001.ogg"
??? "Yo-u-ta! {w=1.4} I came to hang out."
Unfortunately, what seems to happen is that the wait doesn't activate until after the voice file finishes playing so it hangs on "Yo-u-ta!" for 5.4 sec. (4 sec of the file + 1.4 sec wait) Just to make sure I wasn't crazy, I removed the voice line from the file, and the wait worked just as designed.

Is this something that is supposed to happen with voice playback? Or am I missing something here? Appreciate any advice on the matter!
Last edited by Shocking Alberto on Sat Apr 25, 2020 12:21 am, edited 1 time in total.

User avatar
gas
Miko-Class Veteran
Posts: 717
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Voice playback bug? Or perhaps something else...

#2 Post by gas » Sun Mar 29, 2020 7:36 am

Probably that depend on the wait for voice and voice sustain preferences (I only suppose, but that sound logical to me).

I don't think you can somehow have an accurate timing anyway, as that depend on the CPS stated by the player (a low CPS have 'Youta!' last for many seconds... the audio file is unaware when to stop accordingly).
So, to me the best solution sound to split the voice two parts and use an extend.

Code: Select all

voice "voice/v0001a.ogg" # say Youta!
??? "Yo-u-ta!"
voice "voice/v0001a.ogg" # say whatever or not, I didn't undesrtan if that's voiced...
extend " I came to hang out."
That require a click on the user instead of a pause, but seems better to me and have voice play when the corresponding line is shown.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll be not notified about.

10 ? "RENPY"
20 GOTO 10

RUN

User avatar
Shocking Alberto
Newbie
Posts: 12
Joined: Sun Mar 29, 2020 4:58 am
Contact:

Re: Voice playback bug? Or perhaps something else...

#3 Post by Shocking Alberto » Sun Mar 29, 2020 2:40 pm

Thank you for your response. The voice sustain preferences is left at default, which is false, so I'm not sure what effect that would have in this case.

Yeah, I agree that changing the cps would completely render this pointless. It really isn't the end all be all thing to do but the person I'm working with seems to think so and thus I am trying to find a solution assuming the cps isn't manipulated.

Even without using extend, click skipping would achieve the same effect so I think I'm back at square one. I wonder if voice is just on a higher priority thread in terms of what is executed than a text wait. That's my only guess right now. I guess I'll keep reading the documentation and see if I can find an answer that is close enough. Appreciate the suggestion nevertheless!

User avatar
Shocking Alberto
Newbie
Posts: 12
Joined: Sun Mar 29, 2020 4:58 am
Contact:

Re: Voice playback bug? Or perhaps something else...

#4 Post by Shocking Alberto » Tue Apr 14, 2020 2:33 am

So I've been playing around with this a bit more and I noticed a few things.

If instead of using the voice channel I use the sound channel, the wait actually works as it's supposed to. So I guess maybe the voice channel has some higher level of authority where it has to finish doing it's thing before the wait tag actually works? It would almost be case closed if it wasn't for the edge case when I user may want voices on but sound effects turned off which would then cause that voice clip to also be off. Maybe making a custom channel would be the way to go? More debugging to do. /o/

Edit: So the solution I found was to make a custom channel and have the mixer set to voice (or it could be anything really) and not sound so the issue mentioned above won't happen. It's a bit of a weird workaround and silly at the end of the day I suppose to have voices but not use the built-in voice channel but it works so that's that. <o/

Post Reply

Who is online

Users browsing this forum: verysunshine