when ever i try to play audio this error appears
2010-08-27 09:13:40.466 VoiceRecorder[3127:207] Failed with reason: The operation couldn’t be completed. (OSStatus error -43.)
what does it mean
I am physically storing file in Iphone Document folder and copying its name in my database
so when ever I play it from database its correctly get file path
and file name from document and database concat perfectly but unable to play
2010-08-30 12:22:00.592 VoiceRecorder[8140:207] /Users/Username/Library/Application Support/iPhone Simulator/4.0.1/Applications/4BF0B5C7-59C9-462F-94EC- 662EBCE8505E/Documents/30Aug10_12_21_58.aif 2010-08-30 12:22:00.593 VoiceRecorder[8140:207] 30Aug10_12_21_58.aif 2010-08-30 12:22:00.618 VoiceRecorder[8140:207] Failed with reason: The operation couldn’t be completed. (OSStatus error -43.)
need an urgent reply
here is my code
-(IBAction)playevent{
VoiceRecorderAppDelegate *appDelegate=(VoiceRecorderAppDelegate*)[[UIApplication sharedApplication]delegate];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [paths objectAtIndex:0];
NSString *fullpath = [documentsDir stringByAppendingPathComponent:appDelegate.filenamefrompath];
NSFileManager *fileManager = [NSFileManager defaultManager];
// Check if the database has already been created in the users filesystem
BOOL success = [fileManager fileExistsAtPath:fullpath];
// If the database already exists then return without doing anything
if(success) { NSLog(@"Yes exists"); }else{ NSLog(@"no"); }
//return [documentsDir stringByAppendingPathComponent:appDelegate.filenamefrompath];
NSError* err;
NSLog(@"%@",fullpath);
player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:fullpath] error:&err];
//NSString *filePath = [[NSBundle mainBundle] pathForResource:appDelegate.filenamefrompath ofType:@"aif"];
// NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:filePath]; // player = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil];
NSLog(@"%@",appDelegate.filenamefrompath);
player.delegate = self;
if( err ){
//bail!
NSLog(@"Failed with reason: %@", [err localizedDescription]);
}
[player play];
}
Please check my code for error