1
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) {
[recorder prepareToRecord];
recorder.meteringEnabled = YES;
b=[recorder record];
} else {
NSLog(@"ERRORE:");
NSLog([error description]);
}
とIOS AVAudioRecorderのupdatemetersは、シミュレータ上で動作
[recorder updatemeters];
NSLog(@"%f",[recorder peakPowerForChannel:0]);
マイクが見つかりましたモミを(私は思う)を検出し、すべての新しい実行表示される値は異なりますが、同じであるため値を実行しても全く変化しない アイデア?