Has anybody successfully got an audio recording on real device? I've tryed using presentAudioRecorderControllerWithOutputURL but only get a WatchKitRecordingFailedError, and the interface dismissed immediately. If I set WKAudioRecorderControllerOptionsAutorecordKey to NO then the record interface dismissed after I pressed the record button. Please HELP!
And here is my code:
NSURL *directory = [NSURL fileURLWithPath:NSTemporaryDirectory()];
NSURL * outputURL = [directory URLByAppendingPathComponent:@"temp.wav"];
[self presentAudioRecorderControllerWithOutputURL:outputURL preset:WKAudioRecorderPresetNarrowBandSpeech options:@{WKAudioRecorderControllerOptionsActionTitleKey:@"OK", WKAudioRecorderControllerOptionsMaximumDurationKey:@120, WKAudioRecorderControllerOptionsAutorecordKey:@0} completion:^(BOOL didSave, NSError * _Nullable error) {
//so I got didSave=0 and error=Error Domain=com.apple.watchkit.errors Code=6 "Recording failed." UserInfo={NSLocalizedDescription=Recording failed.}
}];
I've also tryed using a group directory instead by it didn't work either.
BTW, anybody can debug on real devices? I can never success on debuging on a real device, so I had to using NSURLSession to send the console log to my server and then be aware of what's going on...
Thanks a log!