问题
Ok so im kind of new to objective-c. I set up an audio recorder using AVAudioRecorder. It works great. but.... i dont know how to access the saved files, heck i dont even know if they get saved. The program is saving them to NSDocumentsDirectory under the name "sounds.caf" at least temporarily. I want to know if these are being permanently saved, if not, then how can i make it so. And then how can i access them after they are saved. Thanks for the help.
Also as a side note id like to know if its possible to combine two sound files and record them together into a new file.
回答1:
You can use below code for saving your audio files.
#define DOCUMENTS_FOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]
#define DOCUMENTS_FOLDER1 [DOCUMENTS_FOLDER stringByAppendingPathComponent:@"Recordering"]
#define FILEPATH [DOCUMENTS_FOLDER stringByAppendingPathComponent:[self dateString]]
BOOL success = [self.myRecorder startRecording:FILEPATH];
if (!success){
printf("Error starting recording\n");
[self.myRecorder stopRecording];
self.myRecorder = nil;
isRecording = NO;
return;
}
来源:https://stackoverflow.com/questions/6849880/saving-and-accessing-audio-recordings