开发者

QTKit makes my program freeze when attempting to play a video while recording sounds from an other source

开发者 https://www.devze.com 2023-02-19 05:12 出处:网络
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 usi

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 开发者_StackOverflow社区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


got the answer

I stopped the QTCaptureSession with -stopRunning launched the video and restarted with -startRunning

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号