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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:32:03+00:00 2026-06-04T18:32:03+00:00

I looked in several forums and they all couldn’t deliver a satisfying answer. My

  • 0

I looked in several forums and they all couldn’t deliver a satisfying answer.

My wish is to be able to play and record video while playing music at the background.
I managed to do that with the help of a snippet I found. here is the code:

    AVAudioSession *session = [AVAudioSession sharedInstance];
session.delegate = self;

NSError *error = nil;
[session setCategory:AVAudioSessionCategoryPlayAndRecord error:&error];

OSStatus propertySetError = 0;

UInt32 allowMixing = true; 

propertySetError = AudioSessionSetProperty (

                                            kAudioSessionProperty_OverrideCategoryMixWithOthers,  // 1

                                            sizeof (allowMixing),                                 // 2

                                            &allowMixing                                          // 3

                                            );
[session setActive:YES error:&error];

The problem is while recording, I can only hear the background music through the ear speaker instead of the regular speaker.

How can I set the regular speaker to work so that the recording session won’t be interrupted?

  • 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-04T18:32:04+00:00Added an answer on June 4, 2026 at 6:32 pm

    When you override the seesion category with *kAudioSessionProperty_OverrideCategoryMixWithOthers* it uses the smaller speaker on the top side of the device (besides the frontend camera). To use the regular speaker as the output device, you should instead redirect the output route of your audio session. The following is the code snippet of achieving this

    UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
    
    AudioSessionSetProperty ( 
        kAudioSessionProperty_OverrideAudioRoute,                         
        sizeof (audioRouteOverride),                                      
        &audioRouteOverride                                               
    ); 
    

    Replace this code with your above and it will work. You can further refer Redirect Output Audio on apple developer portal.

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

Sidebar

Related Questions

I have looked into several editable table plugins but I am not sure they
I've looked at several other questions related, one answer even seemed like it solved
I've looked through several of the questions here and am not quite connecting all
I've looked through several posts on StackOverflow, but haven't been able to find an
I have looked at several options like: * http://blog.waynehartman.com/archive/2012/01/07/uistoryboard-on-ios-5-the-good-the-bad-and-the.aspx * UIPopoverController Anchor Position *
I've looked through several posts but I haven't quite found any answers that have
I've looked at several other suggestions on this issue but for some reason my
I've looked at several other SGen-related questions on here and either their answers don't
I've looked at several questions here that looked similar, but none of them discussed
I have looked through several sites for any useful documentation and have come up

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.