How can I permanently save AVAudioRecorder files for later access?
-
21-09-2019 - |
Question
I have my code all set up to actually record the files. What I need, though, is a way to see where they are all saved and list them in a UITableView
. I'm not asking the the implementation for the table; I only need a way to see where they are all saved.
Solution
All your data is saved into your application's document folder. You can access it with:
NSString *documentsDirectory;
NSArray *paths = NSSearchPathForDirectoriesInDomains
(NSDocumentDirectory, NSUserDomainMask, YES);
if ([paths count] > 0) {
documentsDirectory = [paths objectAtIndex:0];
}
Assign an array to get a list of all your recorded files.
OTHER TIPS
Your url where you are going to save the recorded file:
NSURL *urlOfRecordedFile = [NSURL fileURLWithPath:[NSString stringWithFormat:@"5@/recordFile.caf",[[NSBundle mainBundle] resourcePaht]]];
And here is the actual path of you file
NSLog(@"%@",url);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow