iOS 4.3 and 5.0.

My app downloads (does not stream) audio files, and I want to be a good citizen 
and not assume they are actually audio files until I've verified them. What I 
can't do is this:

+ (BOOL) fileAtURLAppearsValid: (NSURL *) fileURL
{
    AVURLAsset *    localAsset;
    localAsset = [AVURLAsset URLAssetWithURL: fileURL
                                     options: nil];
    return localAsset.readable && localAsset.playable;
}

because if the file is large, AVFoundation won't be able to examine it 
synchronously. 

And I'd like to have a synchronous check, even if it just means magic numbers 
and a sane file size. The problems are that I don't know what the magic numbers 
or sane sizes are; I don't necessarily have a filename extension; and I don't 
even know in advance what formats AVFoundation will accept on the machine I'm 
running on.

Is there a library or something that can give me a quick-and-dirty assessment 
of an audio file?

        — F

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to