• 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: RemoteIO AU callback interval can not be changed?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RemoteIO AU callback interval can not be changed?


  • Subject: Re: RemoteIO AU callback interval can not be changed?
  • From: AI Developer <email@hidden>
  • Date: Wed, 11 Aug 2010 14:17:33 +0530

The AUHAL supports kAudioUnitProperty_MaximumFramesPerSlice (on Scope Output of input bus) - perhaps RemoteIO AU also supports something like that?

Thanks.
Devendra.

On 8/11/10 11:27 AM, email@hidden wrote:
Hi,

I have following call sequences. I've omitted some code just to keep the email
short. Basically, what I do is to setup the RemoteIO AU to capture 8KHz PCM
audio data. I want the microphone callback to be called at a certain interval,
such as 50 ms. I try to use
kAudioSessionProperty_PreferredHardwareIOBufferDuration property on the audio
session. But no matter what value I set it to, my microphone callback always
gets called every 11.5 ms. Any one experiences the same? Any idea why?

Thanks.

Jeff

// set IO buffer to be 50 ms
  Float32 aBufferLength = 0.050; // In seconds
  UInt32 size = sizeof(aBufferLength);
  AudioSessionSetProperty(kAudioSessionProperty_PreferredHardwareIOBufferDuration,


size,&aBufferLength);

// activate audio session
  status = AudioSessionSetActive(active);

   UInt32 flag = 1;
   status = AudioUnitSetProperty(audioUnit,
                                 kAudioOutputUnitProperty_EnableIO,
                                 kAudioUnitScope_Input,
                                 1, //kInputBus,
                                 &flag,
                                 sizeof(flag));

// Init format to 8KHz PCM
audioFormat.mSampleRate = 8000;
audioFormat.mFormatID   = kAudioFormatLinearPCM;
audioFormat.mFormatFlags= kAudioFormatFlagIsSignedInteger |
kAudioFormatFlagIsPacked;
audioFormat.mFramesPerPacket = 1;
audioFormat.mChannelsPerFrame = 1;
audioFormat.mBitsPerChannel = 16;
audioFormat.mBytesPerPacket = 2;
audioFormat.mBytesPerFrame = 2;
audioFormat.mReserved         = 0;

   // Apply format
   status = AudioUnitSetProperty(audioUnit,
                                 kAudioUnitProperty_StreamFormat,
                                 kAudioUnitScope_Input,
                                 0,
                                 &pastream->audioFormat,
                                 sizeof(pastream->audioFormat));

   // Set input callback
   AURenderCallbackStruct callbackStruct;
   callbackStruct.inputProc = micCallback;
   callbackStruct.inputProcRefCon = pastream;
   status = AudioUnitSetProperty(audioUnit,
                                 kAudioOutputUnitProperty_SetInputCallback,
                                 kAudioUnitScope_Global,
                                 kInputBus,
                                 &callbackStruct,
                                 sizeof(callbackStruct));

// Init Audio Unit
....
  _______________________________________________
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
References: 
 >Re: RemoteIO AU callback interval can not be changed? (From: email@hidden)

  • Prev by Date: Re: AudioQueueOfflineRender on the iPad
  • Next by Date: Re: Published! Technical Note TN2274: USB Audio on the Mac
  • Previous by thread: Re: RemoteIO AU callback interval can not be changed?
  • Next by thread: Re: RemoteIO AU callback interval can not be changed?
  • Index(es):
    • Date
    • Thread