I'm using AVAudioRecorder to record audio but I'm experiencing a 4 second delay between button press and beginning to record.

Here's my setup code:

> 
> NSDictionary \*recordSettings = [NSDictionary 
>  dictionaryWithObjectsAndKeys:
> 
> 
> 
> ```
>                                     [NSNumber numberWithFloat: 16000.0],AVSampleRateKey,
>                                     [NSNumber numberWithInt: kAudioFormatAppleIMA4],AVFormatIDKey,
>                                     [NSNumber numberWithInt: 1], AVNumberOfChannelsKey,
>                                     [NSNumber numberWithInt: AVAudioQualityMax],AVEncoderAudioQualityKey,nil];
> 
>     NSError *error = nil;
> 
>     audioRecorder = [[AVAudioRecorder alloc]
>                      initWithURL:soundFileURL
>                      settings:recordSettings
>                      error:&error];
>     if (error)
>     {
>         NSLog(@"error: %@", [error localizedDescription]);
> 
>     } else {
>         NSLog(@"prepare to record");
>         [audioRecorder prepareToRecord];
>     }
> 
> ```
> 
> -(void)record {
> 
> 
> 
> ```
> NSLog(@"Record");
> 
> //[audioRecorder prepareToRecord];
> 
> if (!audioRecorder.recording)
> 
> {
> 
>     NSLog(@"Record 2");
> 
>     [audioRecorder record];
> 
>     NSLog(@"Record 3");        
> 
> } 
> 
> ```
> 
> }
> 
> 
> 

Record is the function called on button press. I know prepareToRecord is called implicitly via 'record' but I wanted to see if it would affect the delay at all. It does not.

Here's the console log:

```
2011-10-18 21:48:06.508 [2949:707] Record
2011-10-18 21:48:06.509 [2949:707] Record 2
2011-10-18 21:48:10.047 [2949:707] Record 3

```

There's about 3.5 seconds before it starts recording.

Are these settings too much for the iPhone? (iPhone 4). Am I initializing it wrong?