iphone - Getting Audio Portion of Video Saved on Camera Roll iOS -
i want audio file of video saved iphones camera roll. have code play video don't know how actual video file , convert mp3 there.
this have far.
- (ibaction)playvideo:(id)sender { [self startmediabrowserfromviewcontroller: self usingdelegate: self]; } - (bool) startmediabrowserfromviewcontroller: (uiviewcontroller*) controller usingdelegate: (id <uiimagepickercontrollerdelegate, uinavigationcontrollerdelegate>) delegate{ if (([uiimagepickercontroller issourcetypeavailable: uiimagepickercontrollersourcetypesavedphotosalbum] == no) || (delegate == nil) || (controller == nil)) return no; uiimagepickercontroller *mediaui = [[uiimagepickercontroller alloc] init]; mediaui.sourcetype = uiimagepickercontrollersourcetypesavedphotosalbum; mediaui.mediatypes = [[nsarray alloc] initwithobjects: (nsstring *) kuttypemovie, nil]; mediaui.allowsediting = yes; mediaui.delegate = delegate; [controller presentmodalviewcontroller: mediaui animated: yes]; return yes; } - (void) imagepickercontrollerdidcancel: (uiimagepickercontroller *) picker { [self dismissmodalviewcontrolleranimated: yes]; } - (void) imagepickercontroller: (uiimagepickercontroller *) picker didfinishpickingmediawithinfo: (nsdictionary *) info { nsstring *mediatype = [info objectforkey: uiimagepickercontrollermediatype]; [self dismissmodalviewcontrolleranimated:no]; if (cfstringcompare ((__bridge_retained cfstringref)mediatype, kuttypemovie, 0) == kcfcompareequalto) { nsstring *moviepath = [[info objectforkey: uiimagepickercontrollermediaurl] path]; mpmovieplayerviewcontroller* themovie = [[mpmovieplayerviewcontroller alloc] initwithcontenturl: [info objectforkey: uiimagepickercontrollermediaurl]]; [self presentmovieplayerviewcontrolleranimated:themovie]; [[nsnotificationcenter defaultcenter] addobserver: self selector: @selector(mymoviefinishedcallback:) name: mpmovieplayerplaybackdidfinishnotification object: themovie]; } } -(void) mymoviefinishedcallback: (nsnotification*) anotification { [self dismissmovieplayerviewcontrolleranimated]; mpmovieplayercontroller* themovie = [anotification object]; [[nsnotificationcenter defaultcenter] removeobserver: self name: mpmovieplayerplaybackdidfinishnotification object: themovie]; }
Comments
Post a Comment