title: Strange sluggish sound recording from AudioUnit
body: <p>The following code sounds very sluggish. What's wrong?</p>
  
  <pre><code>AudioStreamBasicDescription audioFormat;
  audioFormat.mSampleRate = 22050.0;
  audioFormat.mFormatID = kAudioFormatLinearPCM;
  audioFormat.mFramesPerPacket = 1;
  audioFormat.mChannelsPerFrame = 1;
  audioFormat.mBytesPerFrame = 2;
  audioFormat.mBytesPerPacket = 2;
  audioFormat.mBitsPerChannel = 16;
  audioFormat.mReserved = 0;
  audioFormat.mFormatFlags = kLinearPCMFormatFlagIsBigEndian |
  kLinearPCMFormatFlagIsSignedInteger |
  kLinearPCMFormatFlagIsPacked;
  
  //NSString* recordFilePath=[NSTemporaryDirectory() stringByAppendingPathComponent: @"recordedFile.caf"];
  NSString* recordFilePath=@"/recordedFile.caf";
  
  NSURL *toURL = [NSURL fileURLWithPath:recordFilePath];
  
  
  
  
  
  ExtAudioFileCreateWithURL((CFURLRef)toURL, 
                            kAudioFileCAFType, 
                            &amp;audioFormat,
                            NULL, 
                            kAudioFileFlags_EraseFile, 
                            &amp;extAudioFile);
  
  ExtAudioFileSetProperty(extAudioFile,
                        kExtAudioFileProperty_ClientDataFormat, 
                         sizeof(AudioStreamBasicDescription), 
                         &amp;audioUnitOutputFormat);
  
  ExtAudioFileSeek(extAudioFile, 0);
  
  [self EnableAudioInputiPhone];
  </code></pre>