Page 1 of 1

Optimizing music?

Posted: Sun May 09, 2021 2:33 pm
by Karrion
Right now the music of our project is like 90% of the size of it. I know there is a thread for optimizing images and was very useful for reducing the size of those, but couldn't find a similar thread for music. One of the problems we have is that we have to have multiple loops in the music files due to now being able to have seamless loops (we don't know how to use audacity or similar, out composer uses Maestro to compose). Is there an easy way to solve this?

Re: Optimizing music?

Posted: Sun May 09, 2021 3:21 pm
by emz911
First advice would be to convert all your audio into .ogg format.
For the loops, it sounds like you are manually looping several songs into one file, which is not recommended at all because that would create huge file sizes. I’d say separate all of them, have a single file for a single song, and play/loop them within your Renpy scripts. For a single song:

Code: Select all

play music "songname.ogg"
And that would loop the song forever by default, until you tell it to stop.
You can also make music fade in or out to make good transitions:

Code: Select all

play music "songname.ogg" fadeout 2.0 fadein 2.0
If you want different songs to automatically play one after another, do:

Code: Select all

 play music [ "a.ogg", "b.ogg" ] fadeout 1.0 fadein 1.0
Maybe even use the queue function for more control. Everything is documented here: https://www.renpy.org/doc/html/audio.html

Re: Optimizing music?

Posted: Sun May 09, 2021 3:28 pm
by Karrion
We tried using fadeins and fadeouts and all kinds of control but it always leaves like a half second of silence. I tried with tighten in the channel settings and the like to no avail. What I saw is that the best way to produce seamless loops is using sound programs like Audacity, Fruit Loops, and the like, but no tutorial for people with no idea. Also, we are already using .ogg.

Re: Optimizing music?

Posted: Sun May 09, 2021 4:56 pm
by emz911
I think the seconds of silence are from your original soundtracks, try trimming the beginning and end of them so that they immediately play and end.
You can also look up "crossfade," there are a couple forums that talk about this, which might be what you want, though a bit more complicated than what I had:
viewtopic.php?t=45204
viewtopic.php?t=42418

Re: Optimizing music?

Posted: Mon May 10, 2021 11:50 am
by qirien
When you export your OGG files, you can choose the quality with a slider. Lower quality will not sound quite as good, but will be a smaller file size.