从视频中删除音频

时间:2012-09-21 13:31:31

标签: iphone objective-c ios avfoundation

我用图片选择器选择一部电影。问题是我不知道如何从资产中删除音频。任何的想法? 这是我用来检索电影的代码:

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

    NSURL *url =  [info objectForKey:UIImagePickerControllerMediaURL];
    if ([[NSFileManager defaultManager]fileExistsAtPath:movie.id]) {
        [[NSFileManager defaultManager]removeItemAtPath:movie.id error:nil];
        [[NSFileManager defaultManager]removeItemAtPath:movie.convertedID error:nil];
    }
    movie.convertedID=nil;

    [self dismissModalViewControllerAnimated:YES];
    dispatch_async(dispatch_get_main_queue(), ^{
        [self saveNewMovieAt:url];
    });

}

1 个答案:

答案 0 :(得分:1)

在播放试图从资产中删除音频的实例时,将MPMoviePlayerController静音的更好方法:)

据我所知,没有其他方法可以做到这一点..

[[MPMusicPlayerController applicationMusicPlayer] setVolume:0];

                          or

        [myMPMoviePlayerController setVolume:0];