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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:44:04+00:00 2026-05-30T01:44:04+00:00

I am an experienced programmer in C, yet not objective c. I am trying

  • 0

I am an experienced programmer in C, yet not objective c. I am trying to help my friend out by giving him this piece of code in objective c. By the way, this is for an iPhone application. I have all foundations necessary, and as you can see, have declared my sound as soundA, using the – (IBAction) method… In addition, the sound is a simply .wav file no larger than 100 kb.

- (IBAction)soundA:(id)sender {
    CFBundleRef mainBundle = CFBundleGetMainBundle();
    CFURLRef soundFileURLRef;
    soundFileURLRef = CFBundleCopyResourceURL(mainBundle, 
        (CFStringRef) @"soundA", CFSTR ("wav"), NULL);

    UInt32 soundID;
    AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
    AudioServicesPlaySystemSound(soundID);
}

Any help is greatly appreciated! Thanks so much.

  • Kook
  • 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-30T01:44:05+00:00Added an answer on May 30, 2026 at 1:44 am

    Maybe try changing it from an Unsigned Int to SystemSoundID

     - (IBAction)soundA:(id)sender {
            CFBundleRef mainBundle = CFBundleGetMainBundle();
            CFURLRef soundFileURLRef;
            soundFileURLRef = CFBundleCopyResourceURL(mainBundle, 
                (CFStringRef) @"soundA", CFSTR ("wav"), NULL);
    
            SystemSoundID soundID;
            AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
            AudioServicesPlaySystemSound(soundID);
        }
    

    Or go with a more Objective-C approach:

     - (IBAction)soundA:(id)sender {
            NSString *path = [NSString stringWithFormat: @"%@/%@",
                         [[NSBundle mainBundle] resourcePath], name];
    
    
            NSURL* filePath = [NSURL fileURLWithPath: path isDirectory: NO];
            SystemSoundID soundID;
            AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID);
            AudioServicesPlaySystemSound(soundID);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not an experienced C++ programmer and I'm having problems compiling. I've got a
I am not the most experienced GUI programmer, so bear with me here. I
I am not a very experienced C++ programmer, i get a warning when i
I am not a experienced programmer, I need to query the Membership User Collection
This question is not coming from a programmer. (obviously) I currently have a programmer
Let me begin by saying I am not an extremely experienced programmer and would
I'm an experienced C/C++/C#/Objective-C desktop,web, and mobile programmer and I've become accustomed to building
I am an experienced programmer with C++/C# trying to get into the android game
I am an experienced programmer, but new to C. I am trying to learn
Most of experienced programmer knows data alignment is important for program's performance. I have

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.