How to Speed up the audio Playing in MpMoviePlayerController

148 Views Asked by At

I am using MPMoviePlayerController in my app to play the video and audios. I want to give an option to user to play the audio/video slower/faster then the normal speed i.e 0.5x (slower then normal ), 1x (normal speed), 2x (double speed then normal.).

I want to know is there any way that i can speed up/down the MPMoviePlayerController streaming so that user can have options to listen/view the audio/video at slower/faster speed.

1

There are 1 best solutions below

0
Abuzar Amin On

i found the solution to this problem myself. When you use MPMoviePlayerController and make its instance then you have a property of MpMoviePlayerController as currentPlaybackRate. It is set to 1.0 by default means normal playing. If you sets its value to 1.5 or 2.0 then it will play the currently playing audio at that speed.

See the following code.

MPMoviePlayerController *moviePlayer = [MPMoviePlayerController alloc]init];
  moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
  moviePlayer.contentURL = @"http://someduumyUrl.com" ;
  moviePlayer.controlStyle = MPMovieControlStyleDefault;
  [moviePlayer prepareToPlay];
  moviePlayer.currentPlaybackRate = 2.0 // will play the audio at double speed.