Quick validation of an audio file?
Quick validation of an audio file?
- Subject: Quick validation of an audio file?
- From: Fritz Anderson <email@hidden>
- Date: Thu, 17 Nov 2011 16:41:12 -0600
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 (email@hidden)
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:
This email sent to email@hidden