Ren'Py Is there really now way to better organize audio files ? like sub-folder or else ?

Nayko93

Well-Known Member
Feb 3, 2018
1,245
2,730
Hi

I'm impress by the way renpy don't allow you to organize your audio files
when you see what you can do with image, it's a shame that you can't so the same with audio
right now I have 350 audio files for the game and it's just the start and it's really a pain to deal with all those file if I can't organize them better
it's really annoying to each time have to write "audio/title.format"

why renpy can't auto detect the format instead of forcing us to precise it

why can't it work like with image, no need to put the folder name, juste the file name

why can't I put my sounds in sub-folder to have music , sound , ambiant , voice in separate folder...

I know I can define sound before and then use a simpler name for each file but since I use 95% of my sound only one time, it's useless

So, am I missing something, is there a way to make all this simpler or is it just bad program design and I can't do anything about it ?

thanks
 

AnimeKing314

Giant Perv
Game Developer
Jun 28, 2018
395
597
You can have music in separate folders, you just have to specify the folder. For example I have this for my background music with the music inside a music folder I created within the audio folder.
Python:
# Define music
define audio.darknesslight1 = "audio/music/From_Darkness_Light_1_Prelude.mp3"
define audio.darknesslight2 = "audio/music/From_Darkness_Light_2_Fugue.mp3"
define audio.darknesslight3 = "audio/music/From_Darkness_Light_3_Prelude.mp3"
define audio.darknesslight4 = "audio/music/From_Darkness_Light_4_Fugue.mp3"
define audio.darknesslight5 = "audio/music/From_Darkness_Light_5_Prelude.mp3"
define audio.darknesslight6 = "audio/music/From_Darkness_Light_6_Fugue.mp3"
define audio.landstone = "audio/music/Land_of_Stone.mp3"
define audio.shadowworlds1 = "audio/music/Shadow_Worlds_I.mp3"
define audio.shadowworlds2 = "audio/music/Shadow_Worlds_II.mp3"
define audio.shadowworlds3 = "audio/music/Shadow_Worlds_III.mp3"
define audio.shadowworlds4 = "audio/music/Shadow_Worlds_IV.mp3"
As for autodetection/etc, submit it as a feature request. I'm sure it's possible for them to implement in the future.

Final note, since it's relative to the game directory (which is why you have to specify the audio folder) you could actually delete the audio folder entirely and create your own folders for each type of music inside the game folder.
 

Nayko93

Well-Known Member
Feb 3, 2018
1,245
2,730
thanks for your answer

for the first part, like I said :
I know I can define sound before and then use a simpler name for each file but since I use 95% of my sound only one time, it's useless
but the advice on deleting the audio folder and creating one for each sound category is a really god idea, I didn't know I could do that, I thought that renpy only allowed audio file to be placed in a folder named "audio"
so thanks :) that will do it , I just hope some day they implement better stuff to deal with sound
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,363
15,281
I think the autodetection is so strict in order to prevent keywords being taken unintentionally. For example the "main_menu.png" file in the ui folder would autoresolve into "main_menu" which is reserved by Ren'py.
The autodetection is fuckingly lax. It don't even validate that the extension correspond to the effective format of the image. You can have JPEG files named "whatever.png" if you want, it will not care a single second.

It's not the image object named "main_menu" that is reserved by Ren'py, it's the variable named "main_menu". They are two different things. While images can be addressed explicitly ("images/hidden/deeply/in/a/long/path/main_menu.jpg") or by their nickname ("main_menu"), they aren't stored in the store. Therefore a no time they conflict with variables.
Put an image named "main_menu.jpg" (or whatever supported format) on your "/game/images" directory, and try this:
Code:
label start:
    show main_menu
    "[main_menu]"
You'll see the image named "main_menu", while the dialog box will show you the value of the variable named "main_menu".


It don't works for audio, because the autodetection is designed to automatically create the image displayable at init time, and nothing more than that. Audio files not being images, they aren't proceeded by the autodetection, dot.