• 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
Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback


  • Subject: Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
  • From: zheng ying <email@hidden>
  • Date: Thu, 16 Jul 2009 07:30:50 +0800

     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

  • Follow-Ups:
    • Re: Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: Re: MultiChannelMixer vs 3dMixer
  • Next by Date: Re: is Audio Unit and its View in separate host machines possible?
  • Previous by thread: Re: is Audio Unit and its View in separate host machines possible?
  • Next by thread: Re: Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
  • Index(es):
    • Date
    • Thread