小编Whi*_*ney的帖子

SFSpeechRecognizer不可用

我已经下载了示例代码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 检查了互联网连接,
在这种情况下我该怎么办?

谢谢

speech-recognition swift ios10

8
推荐指数
1
解决办法
1475
查看次数

使用AVMutableVideoComposition导出时的视频方向问题

这是我用来导出视频的功能:

- (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)

iphone video avfoundation ios

5
推荐指数
1
解决办法
2118
查看次数

Cocos2d中ccTouchesCancelled和ccTouchesEnded事件有什么区别?

我想知道Cocos2d中ccTouchesCancelled和ccTouchesEnded事件之间的区别是什么?

谢谢!

iphone cocos2d-iphone

4
推荐指数
1
解决办法
1356
查看次数