I was wondering, is there a way to set a custom looped audio channel to automatically fadin and fadeout when using the channel rather than having to specify it when using the play statement?
I tried to take the example in the documentation for play:
Code: Select all
renpy.music.play(filenames, channel='music', loop=None, fadeout=None, synchro_start=False, fadein=0, tight=None, if_changed=False, relative_volume=1.0)
Code: Select all
init python:
renpy.music.register_channel("ambient","sfx",loop=True,stop_on_mute=True, tight=True, fadein=1.0, fadeout=2.0)
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/inits.rpy", line 6, in script
init python:
File "game/inits.rpy", line 7, in <module>
renpy.music.register_channel("ambient","sfx",loop=True,stop_on_mute=True, tight=True, fadein=1.0, fadeout=2.0)
TypeError: register_channel() got an unexpected keyword argument 'fadein'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/inits.rpy", line 6, in script
init python:
File "C:\Users\mmay3\Documents\Renpy\renpy-7.4.11-sdk\renpy\ast.py", line 823, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\mmay3\Documents\Renpy\renpy-7.4.11-sdk\renpy\python.py", line 1178, in py_exec_bytecode
exec(bytecode, globals, locals)
File "game/inits.rpy", line 7, in <module>
renpy.music.register_channel("ambient","sfx",loop=True,stop_on_mute=True, tight=True, fadein=1.0, fadeout=2.0)
TypeError: register_channel() got an unexpected keyword argument 'fadein'
Windows-10-10.0.19045 AMD64
Ren'Py 8.2.1.24030407
Tue Mar 12 20:48:39 2024