iOS 4.0 Volume Fade

822 views Asked by At

No matter what I do I seem to run into problems.

I'm trying to create a fade over time on an actively playing streamed audio. So far the only players that seem to handle audio streaming properly are the MPMoviePlayerController and AVPlayer. Unfortunately neither one of them allow for volume change. (AVPlayer would allow volume change through mixing IF and only if it was performed on a local file).

The best player that would have been of use with volume changing integrated would have been AVAudioPlayer, unfortunately it only works on local files.

Through some research I noticed several discussions regarding Apple not giving control over System Volume (represented in MPVolumeView). Having said that, some apps still seem to be able to affect it. If Apple does not give control over it, how do these guys manage to do it?

Is there a trick behind it? Am I missing something in the documentation somewhere?

Any tip would be appreciated.

1

There are 1 answers

0
steipete On

Some apps may show a hidden MPVolumeView and control it's state with clever subview introspection and hacking. It's an ugly workaround, but when applied carefully not unreasonable. (don't crash but degrade to no fade if the hierarchy changes)