flaviusilaghi
flaviusilaghi

Reputation: 661

Remove audio from video

I pick a movie with the image picker . The problem is that i don't know how to remove the audio from the asset . Any idea? This is the code that i am using to retrieve the movie :

- (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];
    });

}

Upvotes: 0

Views: 1724

Answers (1)

Shamsudheen TK
Shamsudheen TK

Reputation: 31339

better way to Mute MPMoviePlayerController while playing instaed of trying to remove the audio from the asset :)

As per my knowledge, there is no other way to do it..

[[MPMusicPlayerController applicationMusicPlayer] setVolume:0];

                          or

        [myMPMoviePlayerController setVolume:0];

Upvotes: 1

Related Questions