Music and RAM usage

IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
Hello, I have a problem with my music file. It's a OGG file (but I also have MP3), its weight is about 3.5 MB, and it is about 3 minutes long.
When I run a simple app (which contains only one actor playing this music file) in GS Viewer on iPhone 3G, the other RAM usage is near 20 MB.
I tried to change this file to 22/mono, but RAM usage is almost the same. Is there any other way to decrease the RAM usage for this file (but not cropping it)?

Thank you.

Comments

  • scorelessmusicscorelessmusic Member Posts: 565
    I'm not sure if this will help, but I use a rather aggressive setting for afconvert for all my audio files.

    afconvert -f caff -d 'aac ' -c 1 -l Mono $f

    Well, maybe not really super aggressive, but definitely helps knock down the file sizes for me. ^_^
  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    Excuse me for being an ignorant, but what does it mean? :)
  • scorelessmusicscorelessmusic Member Posts: 565
    I convert all my audio files into .caf format before moving them into my GameSalad project. What you see is the command line command that is required.

    This command is entered from the Terminal app on every Mac OSX in the right location etc... Not quite the easiest thing to teach for people who are not familiar with using the command line in Mac OSX, but I'm planning to do a tutorial if possible. ^_^
  • firemaplegamesfiremaplegames Member Posts: 3,211
    I highly recommend using a free program like Audacity to crush your audio files.

    All of the background music files in my games are over 3 minutes long and weigh in at less than 250K each.

    1. Download Audacity.
    2. Open your mp3 or .ogg file in Audacity.
    3. Make all your music Mono instead of Stereo. Under the tracks menu, select 'Stereo Track to Mono'.
    4. In the lower left corner, change your Project Rate to 22050 Hz.
    5. Then use File/Export... to export the file as .m4a
    6. Play with the export settings to get the lowest quality that still sounds good.

    7. Do the same thing for .ogg files for sound FX, just use the ogg vorbis export options.

    Now that of course, is for a game that is graphics, or game-logic heavy.

    If you are making a music app, perhaps keep the stereo and up the quality to .caf files.

    You have to pick your battles. You have very limited RAM to work with. If your game is more about graphics or gameplay, I would allocate more of the RAM for those. If your game is more about the audio, I would smash down the graphics instead.

    Personally I think both are important, and I smash both down as much as possible. I would love stereo music in my games, but I cannot afford it memory-wise.
  • quantumsheepquantumsheep Member Posts: 8,188
    firemaplegames said:
    Personally I think both are important, and I smash both down as much as possible. I would love stereo music in my games, but I cannot afford it memory-wise.

    I hear you there - making my audio tracks mono on my retro game almost halved the project size and increased performance.

    Still sounds good though :D

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    I did as you said, but I don't have option to export as .m4a, and when I choose mp3, then RAM usage in GS is almost the same.

    EDIT: Nope, it helped :) Thank you.

    EDIT 2: OMG, I think I cut off some graphics. Quality of my music is terrible now, and I paid too much for it, to make it sooooo low quality.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Play around with the quality in the export settings of Audacity. You should be able to get it to sound ok.

    Start with the absolute lowest setting and keep increasing it until it sounds good.
Sign In or Register to comment.