0

I'm going to have a large number of mp3 files in my app. Right now, this is what I do:

  • Use On Demand Resources so that the files will not affect the app size;

  • At first launch:

    • If user is connected to WiFi, download all the files and store them in the app documents directory;
    • If user is not connected to WiFi, ask him to download or download later.

Now my question is:

If the total files size reaches more than 300mb for example, it will be a problem since maybe the user will delete the app because he is running out of space. How can I solve this?

I was thinking about:

  • store my files online and play, but then everytime the user wants to play them, he will use mobile data. Or, if the user doesn't have data connection or he is in a place without signal, he won't be able to use the app;

  • compress the files in a zip, then unzip it when the user wants to play them and zip again;

  • ask the user which files he wants to download, and then remove them if he wants to download more.

fabdurso
  • 2,366
  • 5
  • 29
  • 55
  • What format do you use for audio files? Is it wav or some compressed format like mp3 or ogg? – Avt Apr 22 '16 at 11:05
  • mp3 (I will add this detail to the question). by the way, is this the best format or is there something better? (less size without losing quality) – fabdurso Apr 22 '16 at 11:06

1 Answers1

0

Without knowing how an average user will use the app it is impossible to say is it better to download everything, allow user to download only required files or store everything online. In general you should not make user wait or limit app functionality if user has slow connection.

One thing you should do for sure is to decrease files size as much as possible. Zip will not help you since it can not decrease already compressed media files (like mp3, ogg and others).

First off all check that audio bitrate is not too big. Typical bitrates for different purposes:

  • 32kbit/s: AM Radio quality
  • 48kbit/s: Common rate for long speech podcasts
  • 64kbit/s: Common rate for normal-length speech podcasts
  • 96kbit/s: FM Radio quality
  • 128kbit/s: Most common bit rate for MP3 music
  • 160kbit/s: Musicians or sensitive listeners prefer this to 128kbit/s
  • 192kbit/s: Digital radio broadcasting quality
  • 320kbit/s: Virtually indistinguishable from CDs
  • 500kbit/s-1,411kbit/s: Lossless audio encoding such as linear PCM

So if audio contains only speech 48 kbit/s is usually enough. For music 128 should be ok.

Second - you should use better compression codec than mp3. For detail information please check this link http://soundexpert.org/encoders-48-kbps but usually you should use AAC codec.

Avt
  • 16,927
  • 4
  • 52
  • 72
  • hey! should I also refer to http://www.winxdvd.com/resource/pics/aac-vs-mp3-file-size-comparison.jpg ? so depending on the audio length, choose between mp3 and aac? – fabdurso Apr 23 '16 at 14:00
  • @fabersky This picture shows nothing about quality. AAC has better quality (less noises, less sound artifacts) than mp3 with the same bitrate. – Avt Apr 23 '16 at 14:08
  • @fabersky Is this picture from this http://www.winxdvd.com/resource/aac-vs-mp3.htm article? You could find in this article also that "AAC file at **96Kbs** sounds better then MP3 file at **128Kbs**;". – Avt Apr 23 '16 at 14:13