#import <MumbleKit/MKAudio.h>
Instance Methods | |
(BOOL) | - audioShouldBeRunning: |
MKAudioDelegate a set of optional methods that helps MKAudio in its operation.
|
optional |
Called when the MKAudio singleton needs to determine whether it should be running. This is needed because MKAudio abstracts away Audio Session handling on iOS.
The method should return whether or not MKAudio should be running at the time the method is called. A typical app using MumbleKit will shut down MKAudio when it is backgrounded – this must be done manually by the app.
However, Audio Session events can come in at inopportune times. For example, if Siri is acivated while in another app, and your MumbleKit-using app is backgrounded, it is possible that MKAudio's interruption callback on the AudioSession is invoked.
To properly handle such inopportune requests, MumbleKit will ask this delegate method on how to proceed.
In 'Mumble for iOS', we do the following:
If this method is not implemented, MKAudio will fall back to a sane default, depending on OS:
For iOS, audioShouldBeRunning: returns YES if the application state is 'active'.
For Mac OS X, audioShouldBeRunning: always returns YES.
Note: This method is only used for internal decisions in MKAudio. When a MumbleKit client manually cals the start and/or stop methods of MKAudio, this method will not be consulted at all.
audio | The MKAudio singleton instance. |