1) I want to make an Iphone app like Talking Tom. I have downloaded the sample example from :--> https://github.com/zoul/Finch site. It plays fine with given audio file. But I want to play my recorded file with pitch effect. My problem is when I pass my recorded file (Recorded using AVAudioRecorder) the error comes like "Failed to read sound data." please help me why this error occurs. Is there any file format problem when recording file using AVAudioRecorded or any setting problem? my Setting code is here....
NSArray *dirPaths;
NSString *docsDir;
dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
docsDir = [dirPaths objectAtIndex:0];
NSString *soundFilePath = [docsDir stringByAppendingPathComponent:@"sound.caf"];
soundFileURL = [NSURL fileURLWithPath:soundFilePath];
NSDictionary *recordSettings = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt: AVAudioQualityMedium],AVEncoderAudioQualityKey,
[NSNumber numberWithInt:16],AVEncoderBitRateKey,
[NSNumber numberWithInt: 2],AVNumberOfChannelsKey,
[NSNumber numberWithFloat: 44100.0],AVSampleRateKey,
[NSNumber numberWithInt: kAudioFormatLinearPCM], AVFormatIDKey,
[NSNumber numberWithBool:YES],AVLinearPCMIsBigEndianKey,
nil];
NSError *error = nil;
audioRecorder = [[AVAudioRecorder alloc] initWithURL:soundFileURL settings:recordSettings error:&error];
if(error)
{
NSLog(@"error in AudioRecorder Initializing...: %@", [error localizedDescription]);
}
else
{
//audioRecorder.meteringEnabled = YES;
[audioRecorder prepareToRecord];
}
2)I found another example from http://dirac.dspdimension.com/Dirac3_Technology_Home_Page/Dirac3_Technology.html site. In this example I can Play my recorded file but too much disturbance comes. The sound is continuously playing after playing and not able to stop it. Sometimes app crashes when pitch changed.In this example they are using "libDIRAC_iOS4-fat.a" library. so can we use this library ? And how can we stop sound playing.
Is there any way to do this using easily ?
Thanks in advance.