Best way to compress music?

Discussion in 'Public Game Developers Forum' started by eJayStudios, May 8, 2010.

  1. eJayStudios

    eJayStudios Well-Known Member

    Oct 17, 2009
    249
    0
    0
    Hi,

    I need to borrow your wisdom fellow developers.

    I want to include 8 awesome music tracks in my next update to spice up user experience a little. ;)

    My question is what is the best way of compressing/converting mp3 music for iPhones?

    Each track currently is of high bitrate and is ~8mb, which unacceptable.

    Need to find a good balance between size/quality.

    Thank you.
     
  2. Use AFConvert. It's built-into the MacOS and converts audio to lossless CAF format (compressed AIFF). Open a command line and use the following:

    afconvert -f caff -d ima4 [source] [dest]

    Where [source] is the WAV (or whatever format it is) and [dest] is the .caf file you want to make out of it. This should cut the size down by at least half and leave you with 100% quality. The iPhone natively understands CAF format, so you should have no problems.

    NOTE: When I say "cut down the size by half" I mean by half of the uncompressed file size, so if it's a 5-minute WAV file (~50mb) you can get it down to 25mb or less.
     
  3. Eric5h5

    Eric5h5 Well-Known Member

    Convert to AAC (which sounds better at low bitrates), trying increasing levels of compression until it starts sounding noticeably bad, then back off to the previous level. Different types of music will reach the point of sounding bad earlier than others, so there's not one definitive level of compression. Always start with uncompressed, so you don't add lossy compression on top of lossy compression. There's a lot of apps that will do this, but you can always just use Garage Band.

    --Eric
     
  4. xother

    xother Active Member

    Aug 18, 2009
    26
    0
    0
    A bit more information about CAF, CAF is just a container for many audio formats. If it's lossless or not depends on the audio format inside. The example you give will convert into IMA4, a compressed format with a compression rate of roughly 4:1. So the quality won't be 100 % compared to the WAV. The quality can still be acceptable though.

    To make your music smaller you could also try to lower the sample rate or switch from stereo to mono. Just try it and listen if it's still acceptable.

    You're speaking in terms of bitrate, which suggests you're talking about an mp3. If that is the case I would suggest getting the original material in an uncompressed format (WAV) and then try the suggestions posted here.
     
  5. spacecowgoesmoo

    spacecowgoesmoo Well-Known Member

    Sep 4, 2008
    722
    3
    0
    Composer / Level Designer @ Bovinedragon Software
    Los Angeles, USA
    Another thing we usually do is to change all the SFX into mono, since they arn't as important as the music in terms of quality. Saves quite a bit of memory since the SFX are all lossless WAV's :).
     
  6. It isn't lossless? I'd assumed it was simply because it still resulted in a file that was considerably larger than an ordinary 128kb/s MP3. (It was closer to the size of a 320kb/s or higher MP3) Whatever the case, I used this to convert the songs I did for Theme Park Madness, and before I submitted them I did some tests to compare the audio quality between the original WAVs and the CAFs and couldn't tell the difference at all -- and since I was going for top quality I was listening pretty closely.
     
  7. eJayStudios

    eJayStudios Well-Known Member

    Oct 17, 2009
    249
    0
    0
    Thank you guys, lots of good info!

    These are available formats to download:

    Track length: 2:52

    mp3 320k - 6.7mb
    FLAC - 18.6mb
    mp3 VBR High - 6MB
    mp3 VBR Low - 4.4MB
    AAC High - 4.1MB
    AAC Low - 1.8 MB
    Ogg Vorbis - 3.9mb
    ALAC - 19.1mb

    As there is now Wav, which one of this list you reckon is best to work with?

    I want to squeeze each 2 min track into 400-600kb or even less if possible.
     
  8. EssentialParadox

    EssentialParadox Well-Known Member

    Sep 21, 2009
    602
    0
    0
    UK / Toronto
    Use FLAC or ALAC — "Free Lossless Audio Codec" and "Apple Lossless Audio Codec" respectively. If you're doing this on OS X you're probably better off selecting ALAC.

    But I'm sorry to say, it will be very difficult to get down to 400kb from a 2:52 track.

    But your best solution is to use these settings (iTunes is the best AAC encoder):

    - 48kbps
    - mono
    - 41.000Khz
    - VBR
    - High Efficiency

    That will get you to around 700kbps for a 3 min track and still have bearable sound quality. You could take a jump at 32kbps but I wouldn't recommend it, but you can always try it and see how it sounds.

    If you still need less space… well, there's always midi…
     
  9. eJayStudios

    eJayStudios Well-Known Member

    Oct 17, 2009
    249
    0
    0
    thanks mate, will try this and see how it goes..

     
  10. xother

    xother Active Member

    Aug 18, 2009
    26
    0
    0
    Well it isn't lossless, meaning if you would convert it back to the source format it wouldn't be exactly the same bitwise. When listening to it, you'd probably wouldn't notice the difference indeed. The size is a bit bigger than a 320 kbit/s mp3, which has a compression rate of roughly 4.4:1.

    @eJay, for such strict space requirements AAC is probably best. Instead of 44.100 kHz, you could also try 22.050 kHz.
     
  11. qxCharles

    qxCharles Active Member

    Apr 28, 2010
    34
    0
    0
    Very useful to me, too.

    Thanks a lot, guys~
     

Share This Page