title: Combine two .wav files in iPhone using Objective C
body: <p>I want to combine two .wav recording files together.
  Can any one help me figure out how to achieve this.I tried combining the data but the headers are creating problem.
  Can we do the combining as we do to combine the wave files. </p>
  
  <p>This is how i am doing the combine,</p>
  
  <pre><code>NSMutableData *datas = [NSMutableData alloc];
  
  NSData *data1 = [NSData dataWithContentsOfFile: [recordedTmpFile1 path]];
  
  NSData *data2 = [NSData dataWithContentsOfFile: [recordedTmpFile2 path]];
  
   NSLog(@"file1 size : %d", [data1 length]);
  
   NSLog(@"file2 size : %d", [data2 length]);
  
  [datas appendData:data1];
  
    [datas appendData:data2];
  
   NSLog(@"file3 size : %d", [datas length]);
  
              NSURL *combinedPath = [NSURL alloc];
  
  combinedPath = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent: 
  
  [NSString stringWithFormat: @"1_20111215.%@",@"wav"]]];
  
              [[NSFileManager defaultManager] createFileAtPath:[combinedPath path] contents:datas attributes:nil];       
  
              NSFileManager * fm = [NSFileManager defaultManager];
  
  [fm removeItemAtPath:[recordedTmpFile2 path] error:nil];  
  </code></pre>