music vs sound technical discussion (why not always use play sound and .oggs?)
So I've been making a generative music game with A LOT of sound files, I'm already up to 100MB and am not even halfway done. I was an audio major in college so the technical side of me wants to know why anyone would ever use the play music behavior over the play sound one? I know it says "music" is supposed to be for over 30 seconds but it let's me import .ogg over 30 seconds as sound. I've used an AAC, mp4, etc for the play music behavior and it works fine, and then I tried the same thing with a .ogg (imports as sound) and it appears to work the same in terms of RAM and stability. I'm tempted to make everything .ogg because the file sizes are way smaller, I'll continue to do tests and see what the eventual outcome is but was wondering if anyone else knew of a reason why I should not use play sound all the time for all "music" purposes...
Comments
I think ogg files will be run in software which is why we can play multiple files at the same time.
So I find that m4a tracks don't add to the RAM usage. Whereas ogg files do. So a 5 min song imported as a 'sound' will take up a huge amount of RAM.
Unless you have a specific purpose for a long track e.g you want to adjust the pitch in-game or play multiple tracks at the same time - then I think it's best to stick to importing as 'music' which is m4a/aac tracks.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Play Sound vs Play Music
images: 8.6 8.6
sound: 72 58 (only 14mb)
game engine 18.4 17.3
other: 23.7 22.3
total ~119 ~106
the numbers don't exactly add up because of how quickly they change (I'm triggering lots of sounds/particles every second). It would seem that the difference is clear that I should use the play music behavior from the numbers but the thing is the frame rate and play experience is identical (or enough to not notice a difference). I'm usually running 20-30 fps in either, which is fine for what I'm doing. So, I'm still skeptical about whether play music is really going to help me in the long haul. The AAC .m4a file is 1.6mb and the .ogg is 1.8mb so not too much difference in terms of storage.