Search code examples
iphoneobjective-ciosipod

Changing Device Volume


I am developing an Iphone/Ipod Application, in which I am using AVAudioPlayer. I am changing volume of audio through slider, which works correctly, but now I have to change(increase/decrease) slider by pressing the device plus and minus button instead of changing slider by myself. When I press plus/minus button of device, don't know where the control goes? Does anybody know, feel free to help.


Solution

  • Slam and thanks all! I have searched on it. This is valid for MPMusicPlayer, but not for AVAudioPlayer. You can do it.

    MPMusicPlayerController *_musicController = [MPMusicPlayerController iPodMusicPlayer];
    

    But not this for AVAudioPlayer,

    AVAudioPlayer *_audioController = [AVAudioPlayer iPodMusicPlayer];