Verwenden Sie AVAudioRecorder im AVFoundation-Framework. Importieren Sie die AVFoundation Rahmen und Conform zum AVAudioRecorderDelegate eine AVAudioRecorder Instanz erstellen und NSURL Instanz ** SAMPLE CODE
Aufnahme:
[audioSession setCategory:AVAudioSessionCategoryRecord error:nil]; // assign it to recording session
[audioSession setActive:YES error:nil]; // activate it!
NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init];
[recordSetting setValue: [NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey]; // assign this special hardware component as the function to record
[recordSetting setValue:[NSNumber numberWithFloat:44100.0]
forKey:AVSampleRateKey]; //44100 is the sample rate
[recordSetting setValue:[NSNumber numberWithInt: 2]
forKey:AVNumberOfChannelsKey]; // same thing
tmpFile = [NSURL fileURLWithPath:
[NSTemporaryDirectory() stringByAppendingPathComponent:
[NSString stringWithFormat: @"%.0f.%@",
[NSDate timeIntervalSinceReferenceDate] * 1000.0,
@"caf"]]]; // how we identify the audio written to the file to play later
recorder = [[AVAudioRecorder alloc] initWithURL:tmpFile settings:recordSetting
[recorder setDelegate:self];
[recorder prepareToRecord];
[recorder record];
SPIELT:
AVAudioSession * audioSession = [AVAudioSession sharedInstance];
[audioSession setCategory:AVAudioSessionCategoryPlayback error:nil];
[audioSession setActive:YES error:nil];
AVAudioPlayer * player =
[[AVAudioPlayer alloc] initWithContentsOfURL:tmpFile error:nil]; // takes recording data from tmpFile where we wrote the recording in
[player prepareToPlay];
[player play];
Das ist nur etwas Beispielcode .... um dir zu helfen aber ansonsten lies die Dokumentation Ich bin mir nicht sicher wie du den Mund animieren könntest oder ob Sie wollten den Ton ändern, aber das ist ein Anfang für die Aufnahme
Nizza ... Ill versuchen und lassen Sie es wissen .. –
@BalanPrabhu wenn Sie denken, das hat geholfen, können Sie es ankreuzen ... – MCKapur