RSDDefaultAudioSessionController

public final class RSDDefaultAudioSessionController : NSObject, RSDAudioSessionController

The default audio session controller for iOS applications that use background audio.

  • The audio session is a shared pointer to the current audio session (if running). This is used to allow background audio. Background audio is required in order for an active step to play sound such as voice commands to a participant who make not be looking at their screen.

    For example, a Walk and Balance task that measures gait and balance by having the participant walk back and forth followed by having them turn in a circle would require turning on background audio in order to play spoken instructions even if the screen is locked before putting the phone in the participant’s pocket.

    Note

    The application settings will need to include setting capabilities appropriate for background audio if this feature is used.

    Declaration

    Swift

    public private(set) var audioSession: AVAudioSession? {
      get
      }
  • Start the background audio session if needed. This will look to see if audioSession is already started and if not, will start a new session.

    Declaration

    Swift

    public func startAudioSessionIfNeeded()
  • Stop the audio session.

    Declaration

    Swift

    public func stopAudioSession()