5
sto usando questo codice per rilevare il colpo.come rilevare il colpo dal microfono non la voce in iphone?
ma non posso ottenere il colpo. ho voce
NSURL *url = [NSURL fileURLWithPath:@"/dev/null"];
NSDictionary *settings = [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:settings error:&error];
if (recorder) {
[recorder prepareToRecord];
recorder.meteringEnabled = YES;
[recorder record];
levelTimer = [NSTimer scheduledTimerWithTimeInterval: 0.3 target: self selector: @selector(levelTimerCallback:) userInfo: nil repeats: YES];
} else
NSLog(@"error %@",[error description]);
Ma la voce non ha soffiato.
Sì, soffia, non è vero? (Potrebbe andare un po 'meglio se hai spiegato cosa intendi.) –
(E tutto quello che stai facendo è l'avvio di un registratore.) –
finalmente ho capito grazie a tutti – jpd