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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:17:15+00:00 2026-05-25T12:17:15+00:00

I work on custom voip application. It relies in audio input/output on CoreAudio. I

  • 0

I work on custom voip application. It relies in audio input/output on CoreAudio.
I discovered a problem – when application calls AudioOutputUnitStart – it freezes for a few seconds.

    OSStatus status;

InitializeAudioSession();
AudioComponentDescription desc;
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_RemoteIO;
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
mVoiceUnitComponent = AudioComponentFindNext(NULL, &desc);

status = AudioComponentInstanceNew(mVoiceUnitComponent, &mVoiceUnit);
UInt32 enable = 1;
AudioUnitElement inputBus = 1, outputBus = 0;
status = AudioUnitSetProperty(mVoiceUnit, kAudioOutputUnitProperty_EnableIO, 
                                                            kAudioUnitScope_Input, inputBus, 
                                                            &enable, sizeof(enable));
status = AudioUnitSetProperty(mVoiceUnit, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output,
                                                            outputBus, &enable, sizeof(enable));

memset(&mStreamDesc, 0, sizeof(mStreamDesc));
mStreamDesc.mSampleRate = SPK_SAMPLE_RATE;
mStreamDesc.mFormatID = kAudioFormatLinearPCM;
mStreamDesc.mFormatFlags = kAudioFormatFlagsCanonical;
mStreamDesc.mBitsPerChannel = 16;
mStreamDesc.mChannelsPerFrame = 1;
mStreamDesc.mBytesPerFrame = 2;
mStreamDesc.mFramesPerPacket = 1;
mStreamDesc.mBytesPerPacket = 2;
status = AudioUnitSetProperty(mVoiceUnit, kAudioUnitProperty_StreamFormat, 
                                                            kAudioUnitScope_Output, 
                                                            inputBus, &mStreamDesc, sizeof(mStreamDesc));
StartAudioSession();

status = AudioUnitInitialize(mVoiceUnit);
status = AudioUnitSetProperty(mVoiceUnit, kAudioUnitProperty_StreamFormat, 
                                                            kAudioUnitScope_Input, 
                                                            outputBus, &mStreamDesc, sizeof(mStreamDesc));


AURenderCallbackStruct outputCallback;
outputCallback.inputProc = IOSAudio::OutputRenderCallback;
outputCallback.inputProcRefCon = this;
status = AudioUnitSetProperty(mVoiceUnit, kAudioUnitProperty_SetRenderCallback,
                                                            kAudioUnitScope_Input, outputBus, 
                                                            &outputCallback, sizeof(outputCallback));

AURenderCallbackStruct inputCallback;
inputCallback.inputProc = IOSAudio::InputRenderCallback;
inputCallback.inputProcRefCon = this;
status = AudioUnitSetProperty(mVoiceUnit, kAudioOutputUnitProperty_SetInputCallback, 
                                                            kAudioUnitScope_Global, inputBus, 
                                                            &inputCallback, sizeof(inputCallback));


status = AudioOutputUnitStart(mVoiceUnit);

mActive = true;

The SPK_SAMPLE_RATE is 8000 or 32000 – I tested both of them.

May anyone give me advice?

  • 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-25T12:17:16+00:00Added an answer on May 25, 2026 at 12:17 pm

    I made a little investigation.
    Looks I was wrong – there is only simulator’s issue.
    I did not find any cause of this.
    So I add workaround – open audio in worker thread.

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

Sidebar

Related Questions

I need to create a custom application domain to work around a bug in
I'm creating some custom work items in TFS and the helptext field seems handy
I am writing a simple custom work item browser and I'd like it to
I work for a custom cabinetry manufacturer and we write our own pricing program
Two way binding does not work on my custom control with the following internals:
It seems like searching with CAML and SPQuery doesn't work properly against custom metadata,
I'm building some custom tools to work against a JIRA install, and the exposed
I currently work at a company that has a lot of custom applications that
So I have a custom event like this: Work w = new worker() w.newStatus
I am in the process of beginning work on several ASP.NET custom controls. I

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.