Ich implementiere die Audioaufnahme. Es funktioniert gut mit caf
& wave
Format. Aber das Problem ist, dass die Dateigröße zu groß ist.iOS: Audio Recording Dateiformat
Also, kann mir jemand helfen, für Audio-Aufnahme mit Format, das auch im Fenster & Dateigröße ist wenig niedrig gespielt.
Der Code, den ich unter versucht:
dirPaths = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSUserDomainMask, YES);
docsDir = [dirPaths objectAtIndex:0];
NSString *soundFilePath = [docsDir
stringByAppendingPathComponent:@"sound.wave"];
NSLog(@"%@",soundFilePath);
NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];
NSDictionary *recordSettings = [NSDictionary
dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:AVAudioQualityMin],
AVEncoderAudioQualityKey,
[NSNumber numberWithInt:16],
AVEncoderBitRateKey,
[NSNumber numberWithInt: 2],
AVNumberOfChannelsKey,
[NSNumber numberWithFloat:8000.0], AVSampleRateKey,
[NSNumber numberWithInt:8], AVLinearPCMBitDepthKey,
nil];
NSError *error = nil;
audioRecorder = [[AVAudioRecorder alloc]
initWithURL:soundFileURL
settings:recordSettings
error:&error];
if (error)
{
NSLog(@"error: %@", [error localizedDescription]);
} else {
[audioRecorder prepareToRecord];
}
Duplikat von http://stackoverflow.com/questions/4279311/how-to-record-voice-in-m4a-format? – nneonneo
Aufnahme im Format M4a (MPEG-4 AAC). Weitere Informationen finden Sie unter http://stackoverflow.com/questions/4279311/how-to-record-voice-in-m4a-format. – nneonneo