Optimizing sound and music for your game.
sebmat86
Member Posts: 339
I actually came up with this idea on how to optimize music... Ok, so this may be a somewhat far-fetched solution. But it could work rather good in your game.
So let´s say you make a track in GarageBand that ends up being around 5 MB large. And let´s say you would love to have 2-3 cool tracks in your game. What I ended up trying was to speed up the tracks in GarageBand before mixing them down. So instead of having the track 90 or up to 120 bpm i change it to the max, witch is 240 bpm. Then I exported the track to mp3 and ended up having more than halved the file size!! But, you may say, now it is really sped up!
So I imported the mp3 to GS. BUT, AS SOUND, NOT AS MUSIC! This way I can pitch the track any way I like! From a super sped up track to a super slow track, if I like! And also, when importing as sound, I´ve noticed that the looping works much better!!
So, save memory by speeding up the track before mixing it down to mp3. Then importit as sound in GS so that you can slow down the track to the speed you want it to be in. Also, as mentioned, by importing the track as sound, makes the loop unnoticeable!!
You might have to experiment a bit with this, but hope this helps!
/Sebastian @ Venerable Rain
So let´s say you make a track in GarageBand that ends up being around 5 MB large. And let´s say you would love to have 2-3 cool tracks in your game. What I ended up trying was to speed up the tracks in GarageBand before mixing them down. So instead of having the track 90 or up to 120 bpm i change it to the max, witch is 240 bpm. Then I exported the track to mp3 and ended up having more than halved the file size!! But, you may say, now it is really sped up!
So I imported the mp3 to GS. BUT, AS SOUND, NOT AS MUSIC! This way I can pitch the track any way I like! From a super sped up track to a super slow track, if I like! And also, when importing as sound, I´ve noticed that the looping works much better!!
So, save memory by speeding up the track before mixing it down to mp3. Then importit as sound in GS so that you can slow down the track to the speed you want it to be in. Also, as mentioned, by importing the track as sound, makes the loop unnoticeable!!
You might have to experiment a bit with this, but hope this helps!
/Sebastian @ Venerable Rain
Comments
So if you take a 120bpm track at 44.1kHz then speed it up to 240bpm (more correctly: pitch it up, so that the tempo and the pitch is doubled) import it into Gamesalad and then lower the pitch via the sound behaviour's pitch control so it's back to 120bpm all you have done is lower the sample rate to 22.05kHz.
A quicker way would be to simply export your file at 22.05kHz in the first place.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
And all those guys doing 1980s 'chiptune'/8-bit retro type music and effects can drop the bit depth on their audio right down to (unsurprisingly given the genre's name!) 8 bit.
Like you say it all depends on what you are after - and should be done an a sound by sound basis.
Bat ears ?
; )
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
You can prob get away with 96 kbps if your original track is decent.
I reckon the emotional impact of the song/audio is more significant than whatever compression settings you decide to use.
Also keep in mind that 'music' tracks, as opposed to 'sounds' won't really affect your game performance. And now that the limit for mobile downloads on iOS is 50mb many games maybe able to be a bit more generous with the allocation of space for music tracks.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Does lowering the kHz also lower the quality of the track? And is lowering kHz just another way of doing what I did, or is it actually a better way of cutting the size of the track?
Thanks,
Seb
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Our ears naturally have a range (on average) of around 20Hz to 20kHz (20 to 20,000 Hz) so being able to play back sound up to 22.05kHz covers pretty much the range of human hearing.
Drop the sample rate to 32kHz and the maximum frequency you can play back is 16kHz - still pretty decent for most stuff.
Drop the sample rate to 22kHz and the maximum frequency you can play back is 11kHz - which starts to sound a bit crappy as the high frequencies are really aliasing by now.
I wouldn't say lowering the sample rate (the kHz) is any better than your method, it's just more straightforward - both methods end up in exactly the same place.
Sampling rate it just one way to lower the file size of a piece of audio, along with bit depth and bit rate - they all follow the same basic rule, make the numbers smaller and the file get smaller (and sounds worse).
And of course there's always the standby that literally slices your file size in two - convert stereo to mono.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Cheers mate,
Seb
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS