Class AVAudioSession

  • All Implemented Interfaces:
    NSObject

    public class AVAudioSession
    extends NSObject
    API-Since: 3.0
    • Constructor Detail

      • AVAudioSession

        protected AVAudioSession​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • IOBufferDuration

        public double IOBufferDuration()
        The current hardware IO buffer duration in seconds. API-Since: 6.0
      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static AVAudioSession allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • allowHapticsAndSystemSoundsDuringRecording

        public boolean allowHapticsAndSystemSoundsDuringRecording()
        Whether system sounds and haptics can play while the session is actively using audio input. API-Since: 13.0
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • availableCategories

        @NotNull
        public @NotNull NSArray<java.lang.String> availableCategories()
        Get the list of categories available on the device. Certain categories may be unavailable on particular devices. For example, AVAudioSessionCategoryRecord will not be available on devices that have no support for audio input. API-Since: 9.0
      • availableInputs

        @Nullable
        public @Nullable NSArray<? extends AVAudioSessionPortDescription> availableInputs()
        Get the set of input ports that are available for routing. Note that this property only applies to the session's current category and mode. For example, if the session's current category is AVAudioSessionCategoryPlayback, there will be no available inputs. API-Since: 7.0
      • availableModes

        @NotNull
        public @NotNull NSArray<java.lang.String> availableModes()
        Get the list of modes available on the device. Certain modes may be unavailable on particular devices. For example, AVAudioSessionModeVideoRecording will not be available on devices that have no support for recording video. API-Since: 9.0
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • category

        @NotNull
        public @NotNull java.lang.String category()
        Get session category. Examples: AVAudioSessionCategoryRecord, AVAudioSessionCategoryPlayAndRecord, etc. API-Since: 3.0
      • categoryOptions

        public long categoryOptions()
        Get the current set of AVAudioSessionCategoryOptions. API-Since: 6.0
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • currentHardwareInputNumberOfChannels

        @Deprecated
        public long currentHardwareInputNumberOfChannels()
        Deprecated.
        API-Since: 3.0 Deprecated-Since: 6.0
      • currentHardwareOutputNumberOfChannels

        @Deprecated
        public long currentHardwareOutputNumberOfChannels()
        Deprecated.
        API-Since: 3.0 Deprecated-Since: 6.0
      • currentHardwareSampleRate

        @Deprecated
        public double currentHardwareSampleRate()
        Deprecated.
        deprecated. Use the corresponding properties without "Hardware" in their names. API-Since: 3.0 Deprecated-Since: 6.0
      • currentRoute

        @NotNull
        public @NotNull AVAudioSessionRouteDescription currentRoute()
        A description of the current route, consisting of zero or more input ports and zero or more output ports API-Since: 6.0
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • delegate

        @Nullable
        @Deprecated
        public @Nullable AVAudioSessionDelegate delegate()
        Deprecated.
        API-Since: 4.0 Deprecated-Since: 6.0 Deprecated-Message: No longer supported
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • init

        @Deprecated
        public AVAudioSession init()
        Deprecated.
        AVAudioSession is a singleton. Use +sharedInstance instead of -init API-Since: 3.0 Deprecated-Since: 10.0
        Overrides:
        init in class NSObject
      • inputDataSource

        @Nullable
        public @Nullable AVAudioSessionDataSourceDescription inputDataSource()
        Obtain the currently selected input data source. Will be nil if no data sources are available. API-Since: 6.0
      • inputDataSources

        @Nullable
        public @Nullable NSArray<? extends AVAudioSessionDataSourceDescription> inputDataSources()
        DataSource methods are for use with routes that support input or output data source selection. If the attached accessory supports data source selection, the data source properties/methods provide for discovery and selection of input and/or output data sources. Note that the properties and methods for data source selection below are equivalent to the properties and methods on AVAudioSessionPortDescription. The methods below only apply to the currently routed ports. Key-value observable. API-Since: 6.0
      • inputGain

        public float inputGain()
        value in range [0.0, 1.0] API-Since: 6.0
      • inputIsAvailable

        @Deprecated
        public boolean inputIsAvailable()
        Deprecated.
        is input hardware available or not? API-Since: 3.0 Deprecated-Since: 6.0
      • inputLatency

        public double inputLatency()
        The current hardware input latency in seconds. API-Since: 6.0
      • inputNumberOfChannels

        public long inputNumberOfChannels()
        The current number of hardware input channels. Is key-value observable. API-Since: 6.0
      • inputOrientation

        public long inputOrientation()
        Describes the orientation of the input data source (valid for the built-in mic input data source when a stereo polar pattern is selected). API-Since: 14.0
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isInputAvailable

        public boolean isInputAvailable()
        True if input hardware is available. Key-value observable. API-Since: 6.0
      • isInputGainSettable

        public boolean isInputGainSettable()
        True when audio input gain is available. Some input ports may not provide the ability to set the input gain, so check this value before attempting to set input gain. API-Since: 6.0
      • isOtherAudioPlaying

        public boolean isOtherAudioPlaying()
        True when another application is playing audio. Note: As of iOS 8.0, Apple recommends that most applications use secondaryAudioShouldBeSilencedHint instead of this property. The otherAudioPlaying property will be true if any other audio (including audio from an app using AVAudioSessionCategoryAmbient) is playing, whereas the secondaryAudioShouldBeSilencedHint property is more restrictive in its consideration of whether primary audio from another application is playing. API-Since: 6.0
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • maximumInputNumberOfChannels

        public long maximumInputNumberOfChannels()
        Returns the largest number of audio input channels available for the current route API-Since: 7.0
      • maximumOutputNumberOfChannels

        public long maximumOutputNumberOfChannels()
        Returns the largest number of audio output channels available for the current route API-Since: 7.0
      • mode

        @NotNull
        public @NotNull java.lang.String mode()
        Get the session's mode. API-Since: 5.0
      • outputDataSource

        @Nullable
        public @Nullable AVAudioSessionDataSourceDescription outputDataSource()
        Obtain the currently selected output data source. Will be nil if no data sources are available. API-Since: 6.0
      • outputLatency

        public double outputLatency()
        The current hardware output latency in seconds. API-Since: 6.0
      • outputNumberOfChannels

        public long outputNumberOfChannels()
        The current number of hardware output channels. Is key-value observable. API-Since: 6.0
      • outputVolume

        public float outputVolume()
        The current output volume. Value in range [0.0, 1.0]. Is key-value observable. API-Since: 6.0
      • overrideOutputAudioPortError

        public boolean overrideOutputAudioPortError​(long portOverride,
                                                    @Nullable
                                                    @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Use this method to temporarily override the output to built-in speaker. This method is only valid for a session using PlayAndRecord category. This change remains in effect only until the current route changes or you call this method again with the AVAudioSessionPortOverrideNone option. Sessions using PlayAndRecord category that always want to prefer the built-in speaker output over the receiver, should use AVAudioSessionCategoryOptionDefaultToSpeaker instead. API-Since: 6.0
      • preferredHardwareSampleRate

        @Deprecated
        public double preferredHardwareSampleRate()
        Deprecated.
        API-Since: 3.0 Deprecated-Since: 6.0
      • preferredIOBufferDuration

        public double preferredIOBufferDuration()
        API-Since: 3.0
      • preferredInput

        @Nullable
        public @Nullable AVAudioSessionPortDescription preferredInput()
        Get the preferred input port. Will be nil if no preference has been set. API-Since: 7.0
      • preferredInputNumberOfChannels

        public long preferredInputNumberOfChannels()
        API-Since: 7.0
      • preferredInputOrientation

        public long preferredInputOrientation()
        API-Since: 14.0
      • preferredOutputNumberOfChannels

        public long preferredOutputNumberOfChannels()
        API-Since: 7.0
      • preferredSampleRate

        public double preferredSampleRate()
        API-Since: 6.0
      • prefersNoInterruptionsFromSystemAlerts

        public boolean prefersNoInterruptionsFromSystemAlerts()
        API-Since: 14.5
      • prepareRouteSelectionForPlaybackWithCompletionHandler

        public void prepareRouteSelectionForPlaybackWithCompletionHandler​(@NotNull
                                                                          @NotNull AVAudioSession.Block_prepareRouteSelectionForPlaybackWithCompletionHandler completionHandler)
        prepareRouteSelectionForPlaybackWithCompletionHandler: A call to this method is an indication that playback is about to start. This gives the receiver an opportunity to prompt the user to pick an output destination if necessary. The receiver will only prompt if the audio session has been configured with a long-form video route sharing policy. Presenting playback UI (e.g. AVPlayerViewController) and commencing playback should be performed in the completionHandler.
        Parameters:
        completionHandler - Once any potential routing is complete, the completion handler is called with the selected route type and with a BOOL indicating whether playback should begin or not.
      • promptStyle

        public long promptStyle()
        The prompt style is a hint to sessions using AVAudioSessionModeVoicePrompt to alter the type of prompts they issue in response to other audio activity on the system, such as Siri and phone calls. This property is key-value observable. API-Since: 13.0
      • recordPermission

        @Deprecated
        public long recordPermission()
        Deprecated.
        Returns an enum indicating whether the user has granted or denied permission to record, or has not been asked API-Since: 8.0 Deprecated-Since: 17.0 Deprecated-Message: Please use AVAudioApplication recordPermission
      • requestRecordPermission

        @Deprecated
        public void requestRecordPermission​(@NotNull
                                            @NotNull AVAudioSession.Block_requestRecordPermission response)
        Deprecated.
        Checks to see if calling process has permission to record audio. The 'response' block will be called immediately if permission has already been granted or denied. Otherwise, it presents a dialog to notify the user and allow them to choose, and calls the block once the UI has been dismissed. 'granted' indicates whether permission has been granted. Note that the block may be called in a different thread context. API-Since: 7.0 Deprecated-Since: 17.0 Deprecated-Message: Please use AVAudioApplication requestRecordPermissionWithCompletionHandler
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • routeSharingPolicy

        public long routeSharingPolicy()
        Get the route sharing policy. See AVAudioSessionRouteSharingPolicy for a description of the available policies. See setCategory:mode:routeSharingPolicy:options:error: for additional discussion. API-Since: 11.0
      • sampleRate

        public double sampleRate()
        The current hardware sample rate API-Since: 6.0
      • secondaryAudioShouldBeSilencedHint

        public boolean secondaryAudioShouldBeSilencedHint()
        True when another application with a non-mixable audio session is playing audio. Applications may use this property as a hint to silence audio that is secondary to the functionality of the application. For example, a game app using AVAudioSessionCategoryAmbient may use this property to decide to mute its soundtrack while leaving its sound effects unmuted. Note: This property is closely related to AVAudioSessionSilenceSecondaryAudioHintNotification. API-Since: 8.0
      • setActiveError

        public boolean setActiveError​(boolean active,
                                      @Nullable
                                      @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Set the session active or inactive. Note that activating an audio session is a synchronous (blocking) operation. Therefore, we recommend that applications not activate their session from a thread where a long blocking operation will be problematic. Apps may activate a AVAudioSessionCategoryPlayback session when another app is hosting a call (to start a SharePlay activity for example). However, they are not permitted to capture the microphone of the active call, so attempts to activate a session with category AVAudioSessionCategoryRecord or AVAudioSessionCategoryPlayAndRecord will fail with error AVAudioSessionErrorCodeInsufficientPriority. When deactivating a session, the caller is required to first stop or pause all running I/Os (e.g. audio queues, players, recorders, converters, remote I/Os, etc.). Starting in iOS 8, if the session has running I/Os at the time that deactivation is requested, the session will be deactivated, but the method will return NO and populate the NSError with the code property set to AVAudioSessionErrorCodeIsBusy to indicate the misuse of the API. Prior to iOS 8, the session would have remained active if it had running I/Os at the time of the deactivation request. API-Since: 3.0
      • setActiveWithFlagsError

        @Deprecated
        public boolean setActiveWithFlagsError​(boolean active,
                                               long flags,
                                               @Nullable
                                               @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Deprecated.
        API-Since: 4.0 Deprecated-Since: 6.0
      • setActiveWithOptionsError

        public boolean setActiveWithOptionsError​(boolean active,
                                                 long options,
                                                 @Nullable
                                                 @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        API-Since: 6.0
      • setAggregatedIOPreferenceError

        public boolean setAggregatedIOPreferenceError​(long inIOType,
                                                      @Nullable
                                                      @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Controls whether audio input and output are aggregated. Only valid in combination with AVAudioSessionCategoryPlayAndRecord or AVAudioSessionCategoryMultiRoute. See the AVAudioSessionIOType documentation for a more detailed explanation of why a client may want to change the IO type. API-Since: 10.0
      • setAllowHapticsAndSystemSoundsDuringRecordingError

        public boolean setAllowHapticsAndSystemSoundsDuringRecordingError​(boolean inValue,
                                                                          @Nullable
                                                                          @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Set allowHapticsAndSystemSoundsDuringRecording to YES in order to allow system sounds and haptics to play while the session is actively using audio input. Default value is NO. API-Since: 13.0
      • setCategoryError

        public boolean setCategoryError​(@NotNull
                                        @NotNull java.lang.String category,
                                        @Nullable
                                        @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Set session category. API-Since: 3.0
      • setCategoryModeOptionsError

        public boolean setCategoryModeOptionsError​(@NotNull
                                                   @NotNull java.lang.String category,
                                                   @NotNull
                                                   @NotNull java.lang.String mode,
                                                   long options,
                                                   @Nullable
                                                   @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Set session category and mode with options. API-Since: 10.0
      • setCategoryModeRouteSharingPolicyOptionsError

        public boolean setCategoryModeRouteSharingPolicyOptionsError​(@NotNull
                                                                     @NotNull java.lang.String category,
                                                                     @NotNull
                                                                     @NotNull java.lang.String mode,
                                                                     long policy,
                                                                     long options,
                                                                     @Nullable
                                                                     @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Set session category, mode, routing sharing policy, and options. Use of the long-form route sharing policy is only valid in conjunction with a limited set of category, mode, and option values. Allowed categories: AVAudioSessionCategoryPlayback. Allowed modes: AVAudioSessionModeDefault, AVAudioSessionModeMoviePlayback, AVAudioSessionModeSpokenAudio. Allowed options: None. Options are allowed when changing the routing policy back to Default, however. API-Since: 11.0
      • setCategoryWithOptionsError

        public boolean setCategoryWithOptionsError​(@NotNull
                                                   @NotNull java.lang.String category,
                                                   long options,
                                                   @Nullable
                                                   @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Set session category with options. API-Since: 6.0
      • setDelegate_unsafe

        @Deprecated
        public void setDelegate_unsafe​(@Nullable
                                       @Nullable AVAudioSessionDelegate value)
        Deprecated.
        API-Since: 4.0 Deprecated-Since: 6.0 Deprecated-Message: No longer supported
      • setDelegate

        @Deprecated
        public void setDelegate​(@Nullable
                                @Nullable AVAudioSessionDelegate value)
        Deprecated.
        API-Since: 4.0 Deprecated-Since: 6.0 Deprecated-Message: No longer supported
      • setInputDataSourceError

        public boolean setInputDataSourceError​(@Nullable
                                               @Nullable AVAudioSessionDataSourceDescription dataSource,
                                               @Nullable
                                               @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Select a new input data source. Setting a nil value will clear the data source preference. API-Since: 6.0
      • setInputGainError

        public boolean setInputGainError​(float gain,
                                         @Nullable
                                         @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        A value defined over the range [0.0, 1.0], with 0.0 corresponding to the lowest analog gain setting and 1.0 corresponding to the highest analog gain setting. Attempting to set values outside of the defined range will result in the value being "clamped" to a valid input. This is a global input gain setting that applies to the current input source for the entire system. When no applications are using the input gain control, the system will restore the default input gain setting for the input source. Note that some audio accessories, such as USB devices, may not have a default value. This property is only valid if inputGainSettable is true. Note: inputGain is key-value observable. API-Since: 6.0
      • setModeError

        public boolean setModeError​(@NotNull
                                    @NotNull java.lang.String mode,
                                    @Nullable
                                    @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Set the session's mode. Modes modify the audio category in order to introduce behavior that is tailored to the specific use of audio within an application. Examples: AVAudioSessionModeVideoRecording, AVAudioSessionModeVoiceChat, AVAudioSessionModeMeasurement, etc. API-Since: 5.0
      • setOutputDataSourceError

        public boolean setOutputDataSourceError​(@Nullable
                                                @Nullable AVAudioSessionDataSourceDescription dataSource,
                                                @Nullable
                                                @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Select a new output data source. Setting a nil value will clear the data source preference. API-Since: 6.0
      • setPreferredHardwareSampleRateError

        @Deprecated
        public boolean setPreferredHardwareSampleRateError​(double sampleRate,
                                                           @Nullable
                                                           @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Deprecated.
        API-Since: 3.0 Deprecated-Since: 6.0
      • setPreferredIOBufferDurationError

        public boolean setPreferredIOBufferDurationError​(double duration,
                                                         @Nullable
                                                         @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        The preferred hardware IO buffer duration in seconds. The actual IO buffer duration may be different. API-Since: 3.0
      • setPreferredInputError

        public boolean setPreferredInputError​(@Nullable
                                              @Nullable AVAudioSessionPortDescription inPort,
                                              @Nullable
                                              @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Select a preferred input port for audio routing. If the input port is already part of the current audio route, this will have no effect. Otherwise, selecting an input port for routing will initiate a route change to use the preferred input port. Setting a nil value will clear the preference. API-Since: 7.0
      • setPreferredInputNumberOfChannelsError

        public boolean setPreferredInputNumberOfChannelsError​(long count,
                                                              @Nullable
                                                              @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Sets the number of input channels that the app would prefer for the current route API-Since: 7.0
      • setPreferredInputOrientationError

        public boolean setPreferredInputOrientationError​(long orientation,
                                                         @Nullable
                                                         @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Sets the preferred input orientation. The input orientation determines which directions will be left and right when a built-in mic data source with the AVAudioSessionPolarPatternStereo polar pattern is selected. Typically, this orientation should match how the user is holding the device while recording, which will match the application's interface orientation when a single app is on the screen. The actual input orientation may be different, for example, if another app's session is in control of routing. The input orientation is independent of the orientation property of an AVAudioSessionDataSourceDescription. API-Since: 14.0
      • setPreferredOutputNumberOfChannelsError

        public boolean setPreferredOutputNumberOfChannelsError​(long count,
                                                               @Nullable
                                                               @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Sets the number of output channels that the app would prefer for the current route API-Since: 7.0
      • setPreferredSampleRateError

        public boolean setPreferredSampleRateError​(double sampleRate,
                                                   @Nullable
                                                   @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        The preferred hardware sample rate for the session. The actual sample rate may be different. API-Since: 6.0
      • setPrefersNoInterruptionsFromSystemAlertsError

        public boolean setPrefersNoInterruptionsFromSystemAlertsError​(boolean inValue,
                                                                      @Nullable
                                                                      @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Set ringtone and alert interruption preference. Inform the system when the session prefers to not be interrupted by ringtones and alerts. By setting this property to YES, clients will not be interrupted by incoming call notifications and other alerts. Starting in iOS 14.0, users can set a global preference for incoming call display style to "Banner" or "Full Screen". With "Banner" display style, if below property is set to YES then clients will not be interrupted on incoming call notification and user will have opportunity to accept or decline the call. If call is declined, the session will not be interrupted, but if user accepts the incoming call, the session will be interrupted. With display style set as "Full Screen", below property will have no effect and clients will be interrupted by incoming calls. Apps that record audio and/or video and apps that are used for music performance are candidates for using this feature. API-Since: 14.5
      • setSupportsMultichannelContentError

        public boolean setSupportsMultichannelContentError​(boolean inValue,
                                                           @Nullable
                                                           @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Set YES to inform the system if the app can supply multichannel audio content. Default value is NO. This property is intended to be used by 'Now Playing' applications. See https://developer.apple.com/documentation/mediaplayer/becoming_a_now_playable_app for more information about what it means to be a 'Now Playing' application. Typically 'Now Playing' applications will also use AVAudioSessionRouteSharingPolicyLongFormAudio or AVAudioSessionRouteSharingPolicyLongFormVideo. API-Since: 15.0
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • sharedInstance

        @NotNull
        public static @NotNull AVAudioSession sharedInstance()
        Return singleton instance. API-Since: 3.0
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supportsMultichannelContent

        public boolean supportsMultichannelContent()
        API-Since: 15.0
      • version_static

        public static long version_static()
      • prefersInterruptionOnRouteDisconnect

        public boolean prefersInterruptionOnRouteDisconnect()
        Indicates if session will be interrupted on route disconnect. API-Since: 17.0
      • renderingMode

        public long renderingMode()
        Get the currently resolved rendering mode to badge content appropriately. Clients should use this property to determine what to badge content as. API-Since: 17.2
      • setPrefersInterruptionOnRouteDisconnectError

        public boolean setPrefersInterruptionOnRouteDisconnectError​(boolean inValue,
                                                                    @Nullable
                                                                    @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
        Use this method to opt in or opt out of interruption on route disconnect policy. As described in the Audio Session Programming Guide, most media playback apps are expected to pause playback if the route change reason is AVAudioSessionRouteChangeReasonOldDeviceUnavailable. Starting in iOS 17, by default Now Playing sessions will be interrupted if they are active when a route change occurs because of a disconnect event. All other sessions will not be interrupted due to a disconnect event. API-Since: 17.0
      • supportedOutputChannelLayouts

        @NotNull
        public @NotNull NSArray<? extends AVAudioChannelLayout> supportedOutputChannelLayouts()
        Get an array of channel layouts that the current route supports. This property is only supported when the output is routed to ports of type AVAudioSessionPortCarAudio Otherwise, an empty array will be returned. Note that this will return an empty array if session is inactive. Clients should listen to AVAudioSessionRenderingCapabilitiesChangeNotification to be notified when this changes. API-Since: 17.2
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.