• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Quick validation of an audio file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Quick validation of an audio file?
      • From: Jens Alfke <email@hidden>
    • Re: Quick validation of an audio file?
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Crash and dispatch queue
  • Next by Date: Re: Quick validation of an audio file?
  • Previous by thread: Re: Crash and dispatch queue
  • Next by thread: Re: Quick validation of an audio file?
  • Index(es):
    • Date
    • Thread