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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:13:46+00:00 2026-05-20T06:13:46+00:00

I just want to play a little ding on when the splash screen loads.

  • 0

I just want to play a little ding on when the splash screen loads. I’m guesing that goes in the RootViewControler.m under viewDidLoad. As for playing the audio file I’m googled and found a lot of things I haven’t been able to make work.

What type of audio file should it be? wav mp3 etc. or does it matter.

I’m not sure what ofType@”caf” is, but here is what I have found, when I try it I get AVAudioplayer undeclared (which I’m thinking is a total newb error but don’t know):

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    NSURL* musicFile = [NSURL fileURLWithPath:[[NSBundle mainBundle] 
                                               pathForResource:@"click"
                                               ofType:@"caf"]];
    AVAudioPlayer *click = [[AVAudioPlayer alloc] initWithContentsOfURL:musicFile error:nil];
    [click play];
    [click release];
    [super viewDidLoad];
}

Thank you for any help,
R

  • 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-20T06:13:47+00:00Added an answer on May 20, 2026 at 6:13 am

    From the Apple Documentation :
    pathForResource:ofType:

    Returns the full pathname for the resource identified by the specified name and file extension.

      - (NSString *)pathForResource:(NSString *)name ofType:(NSString *)extension
    

    The program looks for a file called click.caf in your main bundle. The warning about AVPlayer being undeclared means that you have to add the AVFoundationFramework to your project and import the proper .h – file with #import <AVFoundation/AVAudioPlayer.h>.

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

Sidebar

Related Questions

I want to play a sound in my application. Nothing special, just a little
Just want to know if publishing an application on Google play is allowed using
I just have an XP machine, and i want to play around using CC.NET.
I have a little start screen running and i want the image, which is
I just want to build a little python music client on my raspberry pi.
Just to play around a little, I'm trying to make a turn-based battle game
I just want to know that how can I save the time of a
Does NSBeep() exist on the iPhone? I just want to play a short error
I just play a little bit with signalR. My application has only one simple
Just want to ask if i can use Custom Validator in client side without

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.