0

My app has a feature to play system music player's music and it has it's own audio too. When music player's music is playing and app's audio will begin to play, I have to decrease the music player volume without affecting app's volume.

I am currently changing music player's volume with MPVolumeView as MPMusicPlayerController volume property is deprecated. But it is system volume which affects app's volume too though I have used [avAudioPlayer setVolume:1.0], which is quite natural.

My question is, is there any way to change the music player's volume without affecting app's volume?

Arnab
  • 4,216
  • 2
  • 28
  • 50

1 Answers1

0

Yo can only change device volume with MPVolumeView. If you want to change application volume, there is AVAudioPlayer. It has volume property, so you can change your volume that way.

Flipper
  • 1,107
  • 1
  • 11
  • 32
  • I am already doing that. I am using `MPVolumeView` to change volume of `MPMusicPlayerController`. Is there any other way to do that? As changing system volume is affecting app's volume also. – Arnab Dec 14 '16 at 06:30
  • You can't change music volume without changing app or device volume. – Flipper Dec 14 '16 at 09:06
  • changing device volume is affecting app's `AVAudioPlayer` volume too. – Arnab Dec 14 '16 at 09:11
  • http://stackoverflow.com/questions/36688123/how-to-set-app-volume-separately-from-system-volume-ios-device-volume-physical – Flipper Dec 14 '16 at 09:17