Ren'Py Trouble defining multiple audio channels.

Mar 16, 2023
18
4
Hey,

I'm trying to define some new audio channels for sound effects, but I'd like my sfx1 and sfx2 channels to be associated with the master 'sound' channel so I can mute all sound effects with the preference menu slider.

sound error.PNG

Here's the code I wrote to register the channels and play the audio file.

Without defining the new channels, I can easily play the sound file just by using
Python:
play sound "audio/TAG-A-1-16_officeamg.ogg" loop fadein 3.0
, but I'd prefer having individual audio tracks for the future when I want to overlap certain audio files.

Here's the error I get:

sound error 2.PNG

What am I doing wrong?
 
Mar 16, 2023
18
4
Ah wait, just a few minutes after posting this I figured it out.

Had to use an init() function to initialize everything before playing anything.

Solution (for anyone in the future finding this thread):

fixed.PNG