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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:41:36+00:00 2026-06-05T17:41:36+00:00

i am develop app with avaudioplayer it’s works perfectly, but,my problem is if my

  • 0

i am develop app with avaudioplayer it’s works perfectly, but,my problem is if my iPhone vibrate mode to open my app avaudioplayer plays audio little bit below seconds, i want to not play a avaudioplayer sound in vibrate mode.

here’s my code:

- (void)viewDidLoad
{
    audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL
                                                                fileURLWithPath:[[NSBundle mainBundle] 
                                                                                 pathForResource:@"audio" ofType:@"mp3"]] error:NULL]; 

    audioPlayer.numberOfLoops =-1;
    audioPlayer.delegate = self;
    audioPlayer.currentTime=0.0f;
    [audioPlayer prepareToPlay];
    [audioPlayer Play]; 

}

can any one help me please..!

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-05T17:41:37+00:00Added an answer on June 5, 2026 at 5:41 pm

    Try:

    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error: nil];
    

    As stated in the Apple Docs:

    AVAudioSessionCategoryAmbient

    For an app in which sound playback is nonprimary—that is, your app can be used successfully with the sound turned off.
    This category is also appropriate for “play along” style apps, such as a virtual piano that a user plays over iPod audio. When you use this category, audio from other apps mixes with your audio. Your audio is silenced by screen locking and by the Silent switch (called the Ring/Silent switch on iPhone).

    Should be what you’re looking for specifically.

    Your audio is silenced by screen locking and by the Silent switch (called the Ring/Silent switch on iPhone)

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

Sidebar

Related Questions

I develop one app for android, on eclipse. It works in the emulator, very
I am currently develop iphone app. the type of the app is Tab Bar.
I am trying to develop app, which records audio & playback.I am able to
I'm develop app for iPhone & iPod and during developing app i used simulator
I'm develop iphone app, what need connect to bluetooth device and handle disconnection of
I want to develop app that get current location in background mode of app
I develop an app for iPhone / iPod Touch which has to have access
I want to develop an app to draw touching the iPhone screen an searching
I just start to develop web app for iPhone with jQtuch..and its fun! Q:
I develop app for android. I test it on many devices but 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.