• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback


  • Subject: Re: Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
  • From: William Stewart <email@hidden>
  • Date: Thu, 16 Jul 2009 19:54:54 -0700

how do you set up your input callback?

On Jul 15, 2009, at 4:30 PM, zheng ying wrote:

     Hi. all
          Why get Error kAudioUnitErr_CannotDoInCurrentContext when
call AudioUnitRender in InputCallback, who can give me some
Help , THANKS.

here is my parameter setting list:

fOutputFormat.mSampleRate = 8000;
fOutputFormat.mFormatID = kAudioFormatLinearPCM;
fOutputFormat.mFormatFlags =
kLinearPCMFormatFlagIsNonInterleaved| kLinearPCMFormatFlagIsSignedInteger;
fOutputFormat.mBytesPerFrame = 2;
fOutputFormat.mBytesPerPacket = 2;
fOutputFormat.mFramesPerPacket = 1;
fOutputFormat.mChannelsPerFrame = 1;
fOutputFormat.mBitsPerChannel = 16;


    // Set the AudioOutputUnit output data format
    err = AudioUnitSetProperty(fAudioUnit,
kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 1,
&fOutputFormat, sizeof(AudioStreamBasicDescription));
    if(err != noErr)
    {
        fprintf(stderr, "failed to set input device ASBD\n");
        return err;
    }

    param = sizeof(UInt32);

    fAudioSamples = 160;

    err = AudioUnitSetProperty(fAudioUnit,
kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global, 0,
&fAudioSamples, param);
...

---------
in my inputcallback we render the data to buffer , got error... code here


    DCAudioFileRecorder *afr = (DCAudioFileRecorder*)inRefCon;
    OSStatus    err = noErr;


// Render into audio buffer err = AudioUnitRender(afr->fAudioUnit, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, afr->fAudioBuffer); //ERROR HERE kAudioUnitErr_CannotDoInCurrentContext ... _______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
      • From: Doug Wyatt <email@hidden>
References: 
 >Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback (From: zheng ying <email@hidden>)

  • Prev by Date: Re: MIDI device/entity/endpoint names formatting on UI and for persistent device references?
  • Next by Date: Re: seeking with aqofflinerender
  • Previous by thread: Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
  • Next by thread: Re: Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
  • Index(es):
    • Date
    • Thread