Is it possible to save .caf file into the photo library ?
In my app, User can record their sound and can upload it to the remote server. So I want to know that is it possible to save recorded voice file into photo library so user can view the previously recorded sound files and upload it ?
I’ve tried to save the .caf using ALAssetsLibrary by :-
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/recordTest.caf",DOCUMENTS_FOLDER]];
ALAssetsLibrary *lib = [[ALAssetsLibrary alloc] init];
[lib writeVideoAtPathToSavedPhotosAlbum:url completionBlock:^(NSURL *assetURL, NSError *error){
if (error)
{
NSLog(@"%@",error);
}
else
{
}
}];
but it generates error…
Error Domain=ALAssetsLibraryErrorDomain Code=-3302 “Invalid data”
UserInfo=0x184b80 {NSLocalizedRecoverySuggestion=Try with different
data, NSLocalizedFailureReason=There was a problem writing this asset
because the data is invalid and cannot be viewed or played.,
NSLocalizedDescription=Invalid data, NSUnderlyingError=0x1834a0
“Invalid data”}
And the answer is
NO. It is not possible to store .caf file to Photo Library.