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

  • SEARCH
  • Home
  • 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 357267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:11:22+00:00 2026-05-12T12:11:22+00:00

I am trying to implement the AudioFileStreamSeek feature on my streaming app. But there

  • 0

I am trying to implement the AudioFileStreamSeek feature on my streaming app. But there is no way I can get this running. Even Matt Gallagher said on his blog:

Icidentally, the AudioFileStreamSeek function seems completely broken. If you can’t get it to work (as I couldn’t) just seek to a new point in the file, set discontinuous to true and let AudioFileStream deal with it.

My code kindda looks like this but I can’t get it to work:

    NSString *path = [[NSString alloc] initWithContentsOfURL: url];

    NSLog(@"url = %@", path);
    SInt64 currentOffset;
    UInt32 flags = 0;

    OSStatus status = AudioFileStreamSeek( audioFileStream, 150, &currentOffset, &flags );
    NSLog(@"Setting next byte offset to: %qi, flags: %d", (long long)currentOffset, flags);

    NSFileHandle *fileHandle = [NSFileHandle fileHandleForReadingAtPath: path];
    // then read data from the new offset set by AudioFileStreamSeek
    [fileHandle seekToFileOffset:currentOffset];
    NSData * data = [fileHandle readDataOfLength:4096];

    NSLog(@"data length %d, bytes %d", [data length], [data bytes]);


    if (discontinuous)
    {
        err = AudioFileStreamParseBytes(audioFileStream, length, bytes, kAudioFileStreamParseFlag_Discontinuity);
        if (err)
        {
            [self failWithErrorCode:AS_FILE_STREAM_PARSE_BYTES_FAILED];
            return;
        }
    }
    else
    {
        err = AudioFileStreamParseBytes(audioFileStream, length, bytes, 0);
        if (err)
        {
            [self failWithErrorCode:AS_FILE_STREAM_PARSE_BYTES_FAILED];
            return;
        }
    }

Please help…

  • 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-12T12:11:22+00:00Added an answer on May 12, 2026 at 12:11 pm

    Lacking any other solutions, what you can do is create an NSConnection and then as you receive the NSData you can effectively create streaming by processing each new chunk of NSData that you receive to your NSConnectionDelegate. NSConnection will make sure to send it to you in order, so you won’t have to worry about getting it ordered correctly. Note though that, depending on your application, you may need to do this outside the main application thread, so that the user can still work with your app even if the download stalls and you have to rebuffer.

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

Sidebar

Related Questions

Trying to implement AVAudioplayer and get some metering data of the played music, but
Im trying to implement this example, but with $.getScript: and for some reason, it
Just trying to implement mobFox into my app, but having trouble to make it
Trying to implement links in my foreach loop. However, can't get the $category link
Trying to implement google C2DM service. registrationIntent.putExtra(app, PendingIntent.getBroadcast(context,0,new Intent(), 0)); registrationIntent.putExtra(sender,example@gmail.com); context.startService(registrationIntent); Almost every
Trying to implement a search similar to here .This searches properties based on city,locality,property
Trying to implement a UITableView of names similar to the built-in Contacts iPhone app
I'm trying implement server code of Server-Sent Events in a generic way that any
Trying to implement an autocomplete based on this It looks like it's very straight
While trying to implement a scene where item sizes do not change but distances

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.