0

In android, ways to get/set stream volume by using AudioManager:

audioManager.getStreamVolume(AudioManager.STREAM_MUSIC)
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,musicVolume,0)

what are equivalents in iOS?

I managed to find categories in AVAudioSessionand system volume But find no way to set/get specific category volume.

AlexWei
  • 1,093
  • 2
  • 8
  • 32

1 Answers1

1

Look at this apple documentation MPVolumeView - https://developer.apple.com/reference/mediaplayer/mpvolumeview.

  • I am looking for a way to get/set it directly without native UI, since I am using Unity here. But your answer provide some clues for me. Thanks – AlexWei Jun 17 '19 at 08:07
  • 1
    Check this link. They should help you get started. -https://stackoverflow.com/questions/36688123/how-to-set-app-volume-separately-from-system-volume-ios-device-volume-physical – codesleeper Jun 17 '19 at 08:14
  • @AlexWei I know this is an old one, but if you found a way to mimic what we can do in Android, could you post your code here or in a gist? Thanks for that. –  Dec 22 '22 at 07:58
  • @OlivierMATROT As far as I can recall, the problem was solved by using a different SDK. I didn't find a native way to do that in iOS at that time. – AlexWei Dec 26 '22 at 03:44