Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5937767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:35:20+00:00 2026-05-22T15:35:20+00:00

long time reader, first time asker… I am making a music app which uses

  • 0

long time reader, first time asker…

I am making a music app which uses AVAssetReader to read mp3 data from the itunes library. I need precise timing, so when I create an AVURLAsset, I use the “AVURLAssetPreferPreciseDurationAndTimingKey” to extract timing data. This has some overhead (and I have no problems when I don’t use it, but I need it!)

Every thing works fine on iphone(4) and ipad(1). I would like it to work on my ipod touch (2nd gen). But it doesn’t: if the sound file is too long (> ~7 minutes) then the AVAssetReader cannot start reading and throws an error ( AVFoundationErrorDomain error -11800. )

It appears that I am hitting a wall in terms of the scanter resources of the ipod touch. Any ideas what is happening, or how to manage the overhead of creating the AVURLAsset so that it can handle long files?
(I tried running this with the performance tools, and I don’t see a major spike in memory).

Thanks, Dan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:35:21+00:00Added an answer on May 22, 2026 at 3:35 pm

    Maybe you’re starting to read too son? As far as I understand, for mp3 it will need to go trough the entire file in order to to enable precise timing. So, try delaying the reading.
    You can also try registering as an observer for some of the AVAsset properties. iOS 4.3 has ‘readable’ property. I’ve never tried it, but my guess would be it’s initially set to NO and as soon as AVAsset has finished loading it gets set to YES.

    EDIT:
    Actually, just looked into the docs. You’re supposed to use AVAsynchronousKeyValueLoading protocol for that and Apple provides an example

    NSURL *url = <#A URL that identifies an audiovisual asset such as a movie file#>;
    AVURLAsset *anAsset = [[AVURLAsset alloc] initWithURL:url options:nil];
    NSArray *keys = [NSArray arrayWithObject:@"duration"];
    
    [asset loadValuesAsynchronouslyForKeys:keys completionHandler:^() {
    
        NSError *error = nil;
        AVKeyValueStatus durationStatus = [asset statusOfValueForKey:@"duration" error:&error];
        switch (durationStatus) {
            case AVKeyValueStatusLoaded:
                [self updateUserInterfaceForDuration];
                break;
            case AVKeyValueStatusFailed:
                [self reportError:error forAsset:asset];
                break;
            case AVKeyValueStatusCancelled:
                // Do whatever is appropriate for cancelation.
                break;
       }
    }];
    

    If ‘duration’ won’t help try ‘readable’ (but like I mentioned before ‘readable’ requires 4.3). Maybe this will solve your issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

long time reader/first time poster here. So I've got a checkbox array that posted
Long time reader, first time poster asks: After many weeks of google and forum
Long time reader, first time poster. I'm a big noob when it comes to
Long time reader, first time poster. Any help is greatly appreciated. I have crafted
long time reader, first time poster. I’m coming with an issue that many of
Long time reader, first time poster. Working on a web site at http://www.howardpitch.com/ ,
(Long time reader of SO, first time asking a q. I'm quite new to
first time poster, long time reader so be gentle with me :) See the
Long time listener, first time caller. I'm a full time SE during the day
long time listener, first time caller... I am creating a splash screen derived from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.