How to make a 2nd sfx channel w/o looping

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
JaydenAndressen
Newbie
Posts: 20
Joined: Wed Jul 15, 2020 11:18 am
Contact:

How to make a 2nd sfx channel w/o looping

#1 Post by JaydenAndressen »

How to I make a 2nd sfx channel without the sound effect looping? I know how to do the code... but when I use the channel to play a sound effect, it just keeps infinitely looping. I don't want it to loop.

Code: Select all

init:
    init python:
        renpy.music.register_channel("sound2", "sfx", True)

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: How to make a 2nd sfx channel w/o looping

#2 Post by Ocelot »

What, do you think, True is doing in channel you are registering?
< < insert Rick Cook quote here > >

User avatar
m_from_space
Miko-Class Veteran
Posts: 952
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: How to make a 2nd sfx channel w/o looping

#3 Post by m_from_space »

Ocelot, you are a socratic teacher. :)

@JaydenAndressen, here is what the function wants as arguments.
https://www.renpy.org/doc/html/audio.ht ... er_channel

User avatar
JaydenAndressen
Newbie
Posts: 20
Joined: Wed Jul 15, 2020 11:18 am
Contact:

Re: How to make a 2nd sfx channel w/o looping

#4 Post by JaydenAndressen »

Oh ok, I understand now.

So it would be:

Code: Select all

init:
    init python:
        renpy.music.register_channel("sound2", "sfx", loop=False)
Or:

Code: Select all

init:
    init python:
        renpy.music.register_channel("sound2", "sfx", False)
Got it, thx guys :)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]