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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:55:35+00:00 2026-05-16T03:55:35+00:00

I am developing an application that involves clicking a button repeatedly, and I am

  • 0

I am developing an application that involves clicking a button repeatedly, and I am giving an audio feedback for this click, a click wave file.

it works fine, but I have a problem, after exactly 248 times, the sound is not played any more, the app doesn’t crash however. and I get the following error:

Error Domain=NSOSStatusErrorDomain Code=-43 “The operation couldn’t be completed. (NSOSStatusErrorDomain error -43.)”

here is the code I am using, (pretty standard)

//file.h
AVAudioPlayer *audioPlayer;


//file.m
    NSString *path=[[NSBundle mainBundle] pathForResource:@"click" ofType:@"wav"];

        [audioPlayer stop]; //I added this in one of my trials to solve it.
        audioPlayer= [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path]  error:&err];
        audioPlayer.numberOfLoops=0;
        audioPlayer.delegate=self;
           [audioPlayer prepareToPlay];



        if (audioPlayer==nil)
            NSLog(@"%@, %@",path,[err description]);
        else
        [audioPlayer play];

any idea why this happens?

  • 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-16T03:55:35+00:00Added an answer on May 16, 2026 at 3:55 am

    I’ve only ever seen that error message associated with streaming audio. Might be something strange happening with the NSURL or…

    Other issue with your code: When do you release the audioPlayer object? If you aren’t, you’re allocating a lot of objects and never releasing them from memory. That could eventually lead to a low memory message.

    Another issue: Apple recommends using an IMA4 encoded *.caf file for playing multiple sounds at once

    Lastly, I have posted a sample project from another question which might show a better way of using AVAudioPlayer …See this post what is the best way to play sound quickly upon fast button presses xcode?

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

Sidebar

Related Questions

I am developing an application that involves some sensitive user information. I retrieve this
I am developing a mac application that involves audio playback. I would like to
I'm developing a Cocoa/Obj-C application that involves a WebView (from the WebKit framework). I've
The model that I am currently developing involves three elements: A client application with
I am developing an application that receives a stream of audio samples from a
I'm developing a web application that involves the use of timestamps. I would like
I am developing an application using twitter api and that involves writing a method
We are developing an application that involves a lot of different tests where each
Background: I'm developing an application that involves taking an existing pdf form and overlaying
I'm developing a web application that involves businesses signing up. What is the best

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.