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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:54:11+00:00 2026-06-13T11:54:11+00:00

I recently implemented sounds into my game. Every time the user touches the screen,

  • 0

I recently implemented sounds into my game. Every time the user touches the screen, an arrow is shot, and a sound is played. I am using the following code to play the sound:

- (void)arrowShoot {
    NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/arrow.mp3", [[NSBundle mainBundle] resourcePath]]];
    arrowShootPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];
    if (arrowShootPlayer != nil) {
        [arrowShootPlayer play];
    }
}

The reason I was allocating memory to the arrowShootPlayer every time is because the user can tap the screen rapidly, and I want the sounds to overlap. Otherwise, the sound only plays once the previous one has finished playing.

Anyway, I am getting this error:

<com.apple.main-thread> shm_open failed: "AppleAudioQueue.36.5755" (23) flags=0x2 errno=24

Once I get this error, the sounds stop being played. Everything else is fine, just the arrow sounds stop playing.

Is there a better way of playing ‘overlapping’ sounds like this on the iPhone, or is there a way around this error??

Thanks

  • 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-13T11:54:11+00:00Added an answer on June 13, 2026 at 11:54 am

    if it is the same audio always, use the playing from memory buffer instead of opening the files. Declare some local buffer:

    NSData* data;
    

    then in your method:

    if(!data) {
       data = [NSData dataWithContentsOfURL:url options:NSDataReadingMappedIfSafe error:&err];
    }
    arrowShootPlayer = [[AVAudioPlayer alloc] initWithData:data error:nil];
    if (arrowShootPlayer) {
        [arrowShootPlayer play];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently I implemented a 'Paused' screen in my game. Since I wanted it to
Interesting problem I ran into recently: I implemented a Stream class (a wrapping stream
I recently implemented a program using the Microsoft Accessibility API, but have since been
I recently implemented Capistrano for the first time with a new cloud production environment.
I haven't implemented binary for a long time, and recently got a requirement to
I just recently implemented: https://github.com/gpambrozio/BlockAlertsAnd-ActionSheets I have imported all the necessary files into my
the PHP framework I am using (Kohana) recently implemented the HMVC architecture. I have
I recently implemented password reset on AD using python ldap module. This involved passing
I am using docmail's Simple API for sending Postcard.They have implemented this functionality recently,
I recently implemented a solution to take an SSIS package and reconfigure the connection

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.