Recording process is stop and just play of this file then Audio Player is not work in iphone sdk?
===

  I have create two function one for recording and second for playing.
 
-(void)initMonitor
{

 NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init];
    [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey];
    [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; 
    [recordSetting setValue:[NSNumber numberWithInt: 1] forKey:AVNumberOfChannelsKey];

    NSArray* documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString* fullFilePath = [[documentPaths objectAtIndex:0] stringByAppendingPathComponent: @"monitor.caf"];
    
    NSURL *soundFileURL = [NSURL fileURLWithPath:fullFilePath];
    NSError *error = nil;
    monitor = [[AVAudioRecorder alloc]
               initWithURL:soundFileURL
               settings:recordSetting
               error:&error];
    
            monitor.delegate=self;
        [monitor setMeteringEnabled:TRUE];
        [monitor prepareToRecord];
        [monitor record];
}

stop recording i want to play of this file but audio player is not work.       
-(void)play
{    
  [monitor stop];

   player = [[AVAudioPlayer alloc] initWithContentsOfURL:outUrl error:&error];
  
   player.delegate = self;
   player.volume = 1.0;

   [player play]; 
}