Search Unity

Audio What are the smallest music file sizes?

Discussion in 'Audio & Video' started by JustColorado, Feb 13, 2019.

  1. JustColorado

    JustColorado

    Joined:
    Dec 19, 2012
    Posts:
    89
    I am trying to make a really light prototype for HTML5 and Google Play Instant Games. I want to keep my entire build less than 10mb, and would like to have at least 10 different songs. (And I don't want to keep downloading more stuff at run time). I have looked into Midi because those files are really small. I tried the Midi Toolkit from the market place and CSharpSynthesizer from Github. Both of those midi players pushed the build size over my limit with just the players.

    Does anyone have any suggestions of how I can get 10 songs in to a game with less than 1mb added to my build size?
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,780
    If you really want go small, you would need think about making synt. music via script. I am sure, there are converters online for HTML5. Or simply compress music files. For example MP3 can go quite small, if you drop 2 channels and reduce sampling and duration.
     
  3. JustColorado

    JustColorado

    Joined:
    Dec 19, 2012
    Posts:
    89
    Thanks. Writing my own synt music sounds like a lot of work. I have never compressed an MP3 before. How do I do that?
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,780
    I would suggest look for existing opens source libraries for HTML5. Search engine and Github may good starting points.
    I know people been doing music players / generators using HTML5.
     
  5. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,305
    use modules / (unity should support them in webgl builds , no idea what you're using for HTML and Google Play Instant Games (but I'm sure JS modules players implementations exist))
    apart form midi format those are probably the tiniest

    as for encoding mp3s: plenty of ways; use ffmpeg, lame, any audio editor which can encode audio, or specialised transcoder such as handbrake
     
  6. JustColorado

    JustColorado

    Joined:
    Dec 19, 2012
    Posts:
    89
    @Antypodish
    @r618

    Thank You! compressing the mp3s did the trick. I just used some online converter.

    I found some setting (45...85bps / 8000mhz)
    It will compress 7 minutes of music down to 1mb and still sounded acceptable
    I will need short 30-45 second looping clips but that is fine.
    This will solve my problem. Thanks
     
    Antypodish likes this.