[Solved] Unable to play voice & toggling auto-mode on/off

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
SethRiley
Regular
Posts: 35
Joined: Sat Mar 18, 2017 3:27 pm
Contact:

[Solved] Unable to play voice & toggling auto-mode on/off

#1 Post by SethRiley »

Hello (^_^)/

I have a little introduction screen at the beginning of the story, which briefly shows the title of the story with a fade effect:

Code: Select all

    scene white
    with Pause(1.5)
    show storytitle with dissolve
    voice "vox/01_0.ogg"
    with Pause(3)
    scene white with dissolve
    with Pause(1)
The bit where it says 'voice "vox/01_0.ogg"' is supposed to play a voice stating the title. However, no voice is played ingame. Turns out the voice will only play if there is text accompanying it on screen, even if it's just a blank surrounded by " "'s. With the code altered to:

Code: Select all

    scene white
    with Pause(1.5)
    show storytitle with dissolve
    voice "vox/01_0.ogg"
    " "
    with Pause(3)
    scene white with dissolve
    with Pause(1)
the voice does play, but the screen will come to a stop until the player clicks to continue. A workaround would be to momentarily toggle auto-mode to on, so it continues, then back off again, like so:

Code: Select all

    toggle auto-mode on
    scene white
    with Pause(1.5)
    show storytitle with dissolve
    voice "vox/01_0.ogg"
    " "
    with Pause(3)
    scene white with dissolve
    with Pause(1)
    toggle auto-mode off
My question is, is there a code by which you can toggle auto-mode on/off from within script.rpy? Or is there perhaps a better way to play a voice during such an intro?
Last edited by SethRiley on Sun Mar 26, 2017 9:39 pm, edited 1 time in total.

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

Re: Unable to play voice without text& toggling auto-mode on

#2 Post by Imperf3kt »

I will have to take your assumption as correct, since I have not yet tried to use voice files. So going by that, use the sound channel? It is technically a sound effect anyway.
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
SethRiley
Regular
Posts: 35
Joined: Sat Mar 18, 2017 3:27 pm
Contact:

Re: Unable to play voice without text& toggling auto-mode on

#3 Post by SethRiley »

Yeah that would be a workaround, but the voice would be treated as a sound effect. If the player would turn down the voice volume for example, it would still be heard.

I'm trying out different codes like "$ renpy.auto(False)" and "$ renpy.preferences.auto(0)" to toggle the auto-mode on/off, but this is grasping at straws really.

Have yet to figure out a way...

Edit: I've found

Code: Select all

$ preferences.afm_enable
but it doesn't seem to solve the problem yet.

User avatar
SethRiley
Regular
Posts: 35
Joined: Sat Mar 18, 2017 3:27 pm
Contact:

Re: [Solved] Unable to play voice & toggling auto-mode on/of

#4 Post by SethRiley »

Found it thankfully :)

What works is:

Code: Select all

    scene white
    with Pause(1.5)
    show storytitle with dissolve
    $ preferences.afm_enable = True
    voice "vox/01_0.ogg"
    " "
    $ preferences.afm_enable = False
    scene white with dissolve
    with Pause(1)
This toggles auto-mode on before the blank text during which the voice is played, and toggles it back off once it's done.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot], Semrush [Bot]