tags:

views:

102

answers:

6

I have an S60 app which I am writing in Qt and which has a large number (several thousand) small audio files attached to it, each containing a clip of a spoken word. My app doesn't demand high fidelity reproduction of the sounds, but even at the lowest bit rate and in mono MP3 they average 6k each. That means my app may have a footprint of up to 10Mb. The nature of the app is such that only a few audio clips will be needed at any one time - maybe as many as 50, but more like 1-10.

So my question has two parts:

1) is 10Mb for a mobile app too large?

2) what is a reasonable alternative to shipping all audio files at install time?

Thanks

+1  A: 

Have you considered rolling all clips into a single file and then seek in the stream? I'm not sure how much the per-file overhead of MP3 is but it might help.

That said, every S60 mobile phone out there should have 1GB or more, so 10MB doesn't sound like "too much". But you should deliver the app as a JAR file which people can download from your website with a PC and then install by cable. Downloading large amounts of data by the phone itself is pretty expensive in many parts of the world (Switzerland, for example).

Aaron Digulla
+1  A: 

In terms of persistent storage, 10Mb isn't a lot for modern mobile devices, so - once downloaded - storing your application data on the device shouldn't be a problem.

The other type of footprint you may want to consider, however, is memory usage. Ideally, you'd have clips buffered in RAM before starting playback, to minimise latency. Given that most Symbian devices impose a per-process default heap size limit of 1Mb, you can't hold all clips in memory, so your app would need to manage the loading and clearing of a cache.

It isn't generally possible to buffer multiple compressed clips at a time on Symbian however, since buffering a clip typically requires usage of a scarce resource (namely an audio co-processor). Opening a new clip while another is already open will typically cause the first to be closed, meaning that you can only buffer one in memory at a time.

If you do need to reduce latency, your app will therefore need to take care of loading and decompressing where necessary, to give PCM which you can then feed to the audio stack.

Gareth Stockwell
+1  A: 

10MB is definitely on the large side. Most apps are < 1MB, but I think that I've seen some large ones (6-10-15 MB), like dictionaries.

Most S60 phones have in-phone storage space of around 100MB, but they also have memory cards and these are usually 128MB+, and 4GB is not uncommon for higher-end phones. You need to check the specs for your target phones!

Having such a large install pack will make installing over the air prohibitive. Try to merge the files so that you only have a few large files instead of many small ones, or the install will take too long.

An alternative would be to ship the most used sounds and download the rest as needed. S60 has security checks and you will need to give the app special permissions when you sign it.

rpg
+1  A: 

Have you thought about separating the thousands of audio files into batches of, say, 20?

You can include a few batches into the application installation file and let the user download one (or more) batch at a time from your application GUI, as and when needed...

QuickRecipesOnSymbianOS
I am inclining towards something similar. The trouble is that the files don't really group neatly and their proximity to one another is largely a function of how the user chooses to use the application. Having said that I can include some basics to start with and query for the remainder as they are used. Once retrieved I'll add the audio files to a client side cache so they don't need to be retrieved again. Now I just have to figure out how to do all this with Qt...
Simon
@Simon Which bit(s) do you want to do in Qt - the downloading, caching, audio playback, or all three? Regarding the latter, Qt for Symbian includes an implementation of the Phonon multimedia APIs, which provide a simple interface for audio playback. Phonon isn't sufficiently flexible, however, for low-latency audio playback - for that you will have to wait for the QtMultimedia APIs, which are still in development.
Gareth Stockwell
A: 

Store the sound files in a SQLite database, and access them only upon demand. Sounds like you are writing a speaking dictionary. Keep the app itself as small as possible. This will make the app load very fast by comparison. As the database market has matured, it seems a developer only needs to know about two database engines anymore: SQLite, for maximum-performance desktop and handheld applications, and MySQL for huge multi-user databases. Do not load all those sounds on startup unless it is critical. My favorite speaking dictionary application is still the creaking Microsoft Bookshelf '96; no kidding.

Vance Tower
presumably that means that I have to package SQLite with my app. What does that do to the download size? Also am I not then bound to Java? I'll investigate this option.
Simon
SQLite doesn't need Java
PiedPiper
A: 
  1. 10MB for a mobile app is not too large provided, you convince the user that the content he / she is going to pull over the air is worth the data charges the user will incur.

Symbian as a platform can work well with this app as the actual audio files will be delivered from within the SIS file but the binary will not contain them and hence will not cause memory problems...

  1. The best option would be to offer the media files for download via your website so that the user can download and sync them via PC- Suite / Mass Storage transfer. Allow the user to download the files into e:\Others or some publicly available folder and offer to read the media from there...

My 2cents...

TheCruisemaniac