STAudioInterruptionEventData
Carries audio-interruption information.
Overview
Audio interruption information, including whether the system indicates that resumption is appropriate. The .audioEnvironment component reports interruption events including .audioInterruptionEnded; the payload does not resume playback automatically. This is the associated payload of STMediaEventData.audioInterruption; inspect the enclosing STMediaEvent to identify the component and event type.
public struct STAudioInterruptionEventData: Sendable {
public let shouldResume: Bool
}
shouldResume indicates whether the interruption information says media processing should resume after the interruption ends.
Purpose and usage
Carries audio-interruption information. Inspect this value when processing the relevant asynchronous event.
Properties
shouldResume— Declared as Bool.
Event payload mapping
STMediaEventData.audioInterruption carries this structure. Match the associated enum case when handling STMediaEvent.data. The event type and function identify the occurrence; the payload provides its event-specific details.
switch event.data {
case .audioInterruption(let interruption):
if interruption.shouldResume {
// Consider resuming after checking application state.
}
default:
break
}