У меня инициализация как:
bool b;
NSLog(@"url");
NSURL *url = [NSURL fileURLWithPath:@"/dev/null"];
NSLog(@"dizionario");
NSDictionary *audioSettings = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithFloat: 44100.0], AVSampleRateKey,
[NSNumber numberWithInt: kAudioFormatAppleLossless], AVFormatIDKey,
[NSNumber numberWithInt: 1], AVNumberOfChannelsKey,
[NSNumber numberWithInt: AVAudioQualityMax], AVEncoderAudioQualityKey,
nil];
NSError *error;
recorder = [[AVAudioRecorder alloc] initWithURL:url settings:audioSettings error:&error];
NSLog(@"audio");
if (recorder) {
//NSLog(@"prepara");
[recorder prepareToRecord];
//NSLog(@"meter");
recorder.meteringEnabled = YES;
//NSLog(@"recorder");
b=[recorder record];
NSLog(@"%@",(b ? @"OK" : @"here it FAILS"));
} else {
NSLog(@"ERRORE:");
NSLog([error description]);
}
//NSLog(@"fine init");
, поскольку я использую [запись рекордера] не удается.Как я могу знать, почему этот метод не работает?как я могу справиться с этой проблемой?спасибо