Tag Archives: AVAudioPlayer

iPhone – Add an UISlider For AVAudioPlayer

We can use AVAudioPlayer to play music. Now i want to add an UISlider as the music progress bar and user can fast skip the music.

Now i have a play button in the view and when user click it, i will play the music file as well as the following method.

  • playButtonClickedRun when the play button is clicked
  • updateSliderRun in 1 second interval to update the UISlider
  • sliderChangeFast skip the music when user scroll the UISlider

Continue reading iPhone – Add an UISlider For AVAudioPlayer

iPhone – Configuring the AVAudioSession and Output Audio to iPhone Speaker

I am working on the AVAudioRecorder and AVAudioPlayer. By default, the output audio is routed to the receiver instead of the iPhone speaker. In order to fulfill my requirement, i have to configure the AVAudioSession in the AppDelegate.

There are 2 ways to route the audio output to speaker.

  • Overriding the output audio route
  • Changing the default output audio route (iPhone OS 3.1 or above)

Continue reading iPhone – Configuring the AVAudioSession and Output Audio to iPhone Speaker