当尝试播放视频同时录制其他来源的声音时,QTKit 使我的程序冻结
我有一个应用程序,我使用 QTKit 来获取有关机器周围声音的实时信息。当这种情况发生时,一些用户事件可能会启动视频的播放(仍然使用 QTKit)。发生这种情况时,我看到视频正在播放,但是输入声音停止被获取和处理。
电影视图在 avakeFromNib 中初始化
mCursor = 0;
mFileManager = [NSFileManager defaultManager];
mPath = [[[mFileManager currentDirectoryPath] stringByAppendingString:@"/Vids/"]retain];
mMovieFiles= [[[mFileManager contentsOfDirectoryAtPath:mPath error:nil]filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self ENDSWITH '.mov'"]]retain];
[mMovie init];
[mMovieView setControllerVisible:NO];
[mMovieView setEditable:NO];
当播放被点击时,音频输入流停止
if (sender==mPlay)
{
[mGraphView setHidden:YES];
[mMovieView setHidden:NO];
mMovie = [[QTMovie movieWithFile:[mPath stringByAppendingString:[mMovieFiles objectAtIndex:mCursor]] error:nil] retain];
[mMovieView setMovie:mMovie];
[mMovieView setNeedsDisplay:YES];
[mMovieView play:self];
}
关于如何使它工作的想法?
提前致谢
I have an application where I use QTKit to acquire realtime information about the sounds surrounding the machine. While this is happening some user events may launch the playback of a video (still using QTKit). When this happens I see the video playing however the input sound stops being acquired and processed.
The movie View is initialized in the avakeFromNib
mCursor = 0;
mFileManager = [NSFileManager defaultManager];
mPath = [[[mFileManager currentDirectoryPath] stringByAppendingString:@"/Vids/"]retain];
mMovieFiles= [[[mFileManager contentsOfDirectoryAtPath:mPath error:nil]filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self ENDSWITH '.mov'"]]retain];
[mMovie init];
[mMovieView setControllerVisible:NO];
[mMovieView setEditable:NO];
When Play is hit the audio input stream stops
if (sender==mPlay)
{
[mGraphView setHidden:YES];
[mMovieView setHidden:NO];
mMovie = [[QTMovie movieWithFile:[mPath stringByAppendingString:[mMovieFiles objectAtIndex:mCursor]] error:nil] retain];
[mMovieView setMovie:mMovie];
[mMovieView setNeedsDisplay:YES];
[mMovieView play:self];
}
Any idea on how to make it work ?
Thank's in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
得到答案
我用
-stopRunning
停止了 QTCaptureSession 启动了视频并用-startRunning
重新启动got the answer
I stopped the QTCaptureSession with
-stopRunning
launched the video and restarted with-startRunning