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 8370217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:51:45+00:00 2026-06-09T13:51:45+00:00

I want to know what’s equivalent to using AVAudioPlayerDelegate ‘s audioPlayerDidFinishPlaying:successfully: method in OpenAL.

  • 0

I want to know what’s equivalent to using AVAudioPlayerDelegate‘s audioPlayerDidFinishPlaying:successfully: method in OpenAL. For example:

-(void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag
{
    // (code or conditions for when the audio has finished playing...)
}
  • 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-06-09T13:51:46+00:00Added an answer on June 9, 2026 at 1:51 pm

    Generally speaking, OpenAL won’t notify you when audio has finished playing, so there’s no real equivalent to the AVAudioPlayerDelegate. The easiest way is to simply delay a function/block call by the length of the audio. As an example, you could use libdispatch (aka Grand Central Dispatch) to add a block to a queue after a set amount of time:

    dispatch_time_t delay;
    dispatch_queue_t queue;
    dispatch_block_t block;
    uint64_t audio_length_ns = 10000000000; // 10 seconds
    
    delay = dispatch_time(DISPATCH_TIME_NOW, audio_length_ns);
    queue = dispatch_get_main_queue();
    
    block = ^{
      // Do whatever you need to after the delay
      // Maybe check to see if the audio has actually
      // finished playing and queue up the block again
      // if it hasn't.
    };
    
    // Queue up the block for the time after 
    dispatch_after(delay, queue, block);
    

    The slightly harder way is, as mentioned in the comment inside the block, to check if OpenAL is finished in the block and, if it isn’t, to push the block onto the queue again (probably with a shorter delay, especially if you can approximate how much longer it’ll be). In general, though, you probably won’t need to be spot-on and just being in a decent range of the sound’s completion is good enough.

    You can also schedule this sort of thing via other methods, like performSelector:withObject:afterDelay:, but that comes down more to your preference as far as API is concerned. The idea is pretty much the same.

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

Sidebar

Related Questions

want to know why String behaves like value type while using ==. String s1
I want know the passed time that also is between two date, for example
I've found an emulator for 80x86 created by using Java, and I want know,
I want know how I can add values to my vector of structs using
I'm Using Visual Basic 2010, and what i want know is how i can
I want know to make a query using linq, between a collection of objects
i want know how i can manage multiple twitter account on iOS in my
i want know if is possible, to get a specific element value of a
please help me. I want know about what types of flags to run an
I have an android app it displays web view.I want know the app idle

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.