我已经下载了示例代码SpeakToMe:https :
//developer.apple.com/library/prerelease/content/samplecode/SpeakToMe/Introduction/Intro.html
在设备上运行它并开始录制但没有收到任何响应.经过一点调试后,我看到speechRecognizer.isAvailable为false.但有时它仍然可用并正常工作.我已经通过https://developer.apple.com/reference/speech/sfspeechrecognizer/1649885-isavailable 检查了互联网连接,
在这种情况下我该怎么办?
谢谢
这是我用来导出视频的功能:
- (void) videoOutput
{
//1 - Early exit if there's no video file selected
if (!self.videoAsset) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Please Load a Video Asset First"
delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
return;
}
// 2 - Create AVMutableComposition object. This object will hold your AVMutableCompositionTrack instances.
AVMutableComposition *mixComposition = [[AVMutableComposition alloc] init];
// 3 - Video track
AVMutableCompositionTrack *videoTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo
preferredTrackID:kCMPersistentTrackID_Invalid];
[videoTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, self.videoAsset.duration)
ofTrack:[[self.videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]
atTime:kCMTimeZero error:nil];
// 3.1 - Create AVMutableVideoCompositionInstruction …Run Code Online (Sandbox Code Playgroud) 我想知道Cocos2d中ccTouchesCancelled和ccTouchesEnded事件之间的区别是什么?
谢谢!
田