NSString recordFile = [NSTemporaryDirectory() stringByAppendingPathComponent: (NSString)inRecordFile];
NSArray *docPaths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString docDir=[[docPaths objectAtIndex:0]stringByAppendingPathComponent: (NSString)inRecordFile];
url = CFURLCreateWithString(kCFAllocatorDefault, (CFStringRef)docPaths, NULL);
// create the audio file
XThrowIfError(AudioFileCreateWithURL(url, kAudioFileCAFType, &mRecordFormat, kAudioFileFlags_EraseFile,
&mRecordFile), "AudioFileCreateWithURL failed");
CFRelease(url);