NSString * outPath = [[NSString alloc] initWithFormat:@"%@/Documents/test.mp3",NSHomeDirectory()];
//----------------------
NSFileManager *fileMgr = [NSFileManager defaultManager];
NSError *error;
if ([fileMgr fileExistsAtPath:outPath]) {
[fileMgr removeItemAtPath:outPath error:&error];
NSLog(@"删除mp3文件");
}
//----------------------
FILE *file = fopen([path cStringUsingEncoding:NSASCIIStringEncoding], "a+");
fwrite(mp3buffer, recvLen, 1, file);
fclose(file);
//-------------------------
NSString * docs = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject;
NSString* path = [docs stringByAppendingPathComponent:@"Recording.m4a"];