i record some file then play it with :
NSArray *dirPaths;
NSString *docsDir;
dirPaths = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSUserDomainMask, YES);
docsDir = [dirPaths objectAtIndex:0];
NSString *soundFilePath = [docsDir
stringByAppendingPathComponent:@"temp0.caf"];
//play
[[SimpleAudioEngine sharedEngine] preloadEffect:soundFilePath];
[[SimpleAudioEngine sharedEngine] playEffect:soundFilePath pitch:1.5f pan:0.0f gain:0.3f];
it works at the first time, but second time it plays the same file again even that i have already recorded some other file .
any help ?
What I think is happening is your audio file is refusing to be overwritten by the new one. Maybe you should try to change the name of the file every time that the user records one. So that when he records, you save the file as a string, with the format:
Then whenever the user wants to record, you increase 'number' by one.