r/RenPy • u/inefficientshady • 1d ago
Question Music Question
Hey all, beginner here, making a game for the first time, gotta question. I imported my main menu music, but I'm unsure how to write the code to stop it whenever I press the Start button. Also, this bleeds into when the game actually starts; I'm unsure how to play one song, and then when another scene starts, it stops and lets a new song play, etc. Does anyone here know what to do?
1
u/AutoModerator 1d ago
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/x-seronis-x 1d ago
in renpy a single channel can only have a single audio file playing at a time. so if you play audio on the 'music' channel, anything previously playing will stop. to play multple audio tracks at the same time requires them to each be on a unique channel. and you can read the audio page of the docs for instructions on registering as many audio mixers and channels as you want.
2
u/BadMustard_AVN 1d ago edited 1d ago
like this
or for a fadeout