I'm currently working on an app that requires me to download a list of objects. I display these objects as buttons and anytime a button is pressed I need to play a sound that is also located on the server.
I have all the information, the file, path, etc. The question is what is the best way to go about this. Should I 1) Download all the files ahead of time to pre-load the files. Or should I stream them? Or is there another option?
If I download the files, how would I go about this and would I store these in local memory or save them to the documents folder? There is a total of 5,000 potential short sound files.
EDIT: I know how to get the data in a NSMutableData *downloadData variable. The question is how do I get that to a sound file. Typically I load sound files from the main bundle. Ideally I'd download the file and do something like:
SystemSoundID soundID;
NSURL *soundPath = [NSURL fileURLWithPath:[dict objectForKey:@"FileName"]];
AudioServicesCreateSystemSoundID((CFURLRef)soundPath, &soundID);
If I stream it, is there an example handy or a framework that i can use as a reference? I checked out the docs and got a guidelines but no examples. If you know of one please just point the way.
Thanks!!
-David