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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:10:58+00:00 2026-06-09T15:10:58+00:00

I have a firing sound in the iOS app I’m developing, although at the

  • 0

I have a firing sound in the iOS app I’m developing, although at the moment the volume of the sound is controlled by the ringer volume, not the main volume. I thought it was because it was a .caf file, but after replacing it with an mp3 it did not change the volume type it is controlled with.

I think it is because I’m using AudioServicesCreateSystemSoundID, which I’m assuming applies only to the ringer volume.

- (IBAction)fire_rifle {
    CFBundleRef mainBundle = CFBundleGetMainBundle();
    CFURLRef soundFileURLRef;
    soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"rifle", CFSTR ("caf"), NULL);
    UInt32 soundID;
    AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
    AudioServicesPlaySystemSound(soundID);
}

How would I change this code so that the main volume is used instead of the ringer volume?

  • 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-09T15:10:59+00:00Added an answer on June 9, 2026 at 3:10 pm

    As stated in the other answers you can use AVAudioPlayer for this. However, here is some sample code:

    <AVAudioPlayerDelegate>
    

    Be sure to include this ^^

    - (void)myMethod{
            AVAudioPlayer *data;
            NSString *name = [[NSString alloc] initWithFormat:@"mySoundName"];
            NSString *source = [[NSBundle mainBundle] pathForResource:name ofType:@"mp3"];
            if (data) {
                [data stop];
                data = nil;
            }
            data=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath: source] error:NULL];
            data.delegate = self;
            [data prepareToPlay];
                    [data play];
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small Android app and currently I am firing a sql statement
The OnSelectedIndexChanged event is not firing for my dropdown box. All forums I have
In my iOS application, I have a timer firing up, and when it fires,
I have an ASP.Net 2.0 application in which the Session_Start event is not firing
If I have a jQuery .click() event firing for both body and a div,
I have the following code: //------------------------------------------------------// // When the document is ready, start firing
say I have a UITableView and upon selecting a new table row (thus firing
As I have mentioned in the title, my dispatch_async is firing 10 times. And
Is there a way to delay css from firing using jquery? I have some
I'm making a program where you're firing a 'blaster', and I have 5 ammo.

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.