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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:30:16+00:00 2026-06-02T17:30:16+00:00

Our app uses the remoteIO (audio-unit) to get audio input from mic, and DSP

  • 0

Our app uses the remoteIO (audio-unit) to get audio input from mic, and DSP over it in real time, it has a callback function that gives me the buffer, and I work on it.

At the same time, we need to play sounds over avAudioPlayer.

I put in my init this : (route the sounds to speaker and let it play and record)

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

but then I have seen something strange. The sounds are playing from the small speaker – the one you use to put your ears on, in phone calls.

Then I did a trick.
I have seen that in order to really route the sounds to the speakers, I have to play something and in the same time execute this 4 lines above.
If I do it 1 time, then the sounds are moving back to the speakers forever.
I did that with a timer that calls the method, and the moment this method executes them, I play sound with avaudioPlayer, then-it fix it and sound routes to speakers.

Any one has any solution, or explanation about that thing?
I really need to play sounds via speakers, without tricks.

  • 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-02T17:30:17+00:00Added an answer on June 2, 2026 at 5:30 pm

    The reason why it plays forever is that the mic picks up the sound played and it enters a loop AKA the Larsen effect

    You can force the sound to the bottom speaker with

    -(void)setSpeaker
    {
        OSStatus error;
        UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; 
        error = AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute, sizeof (audioRouteOverride), &audioRouteOverride);
        if (error) NSLog(@"Couldn't route audio to speaker");
    }
    

    You can also present a UI to the user to chose the bottom or top speaker with a MPVolumeView

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

Sidebar

Related Questions

Our app uses a component that requires a license file in the directory with
Our app uses a string to house character-values used to indicate enum values. for
Background: Our web app uses the jquery.constrain.js plugin to handle data entry in some
I'm having a problem at work in that our app which uses WCF for
Our company uses an app that was originally ColdFusion + Access later converted to
Our app supports different browser version from IE to Firefox to Chrome. Now, some
We have a gwt app that uses jcifs to pull the user name from
We have a Spring application that uses Apache DBCP for connection pooling. Our app
We are doing some optimization of our app that heavily uses EWS and one
We are porting our app to Delphi XE2 from Delphi 6. Problem is, the

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.