> ## Documentation Index
> Fetch the complete documentation index at: https://sdk.sleepcycle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# iOS Release Notes

## Version 1.2.0

### New Features

* **Smart alarm**: Configure a wake-up window via `SmartAlarmConfig` and observe alarm lifecycle events through the new `smartAlarmStream: AsyncStream<SmartAlarmEvent>`. Event types are `.armed` and `.triggered(reason)`, with reasons `.optimalWakeUp`, `.userInteraction`, and `.windowEnd`. Smart alarm is gated behind the `smartAlarm` feature and only supported on the primary channel.
* **Stereo channel separation**: New `ChannelSeparationConfig` controls how stereo audio channels are assigned to analysis channels, with built-in presets `.bedSideMics`, `.centeredMicArray`, and `.detectionStrengthOnly`.
* **Configurable audio input**: New `AudioInputConfig` selects the audio format (mono/stereo) and a preferred input device when creating a live data source via `createLiveDataSource(audioConfig:)`.
* **Sleep score**: Compute a per-night sleep score with `SleepScoring.compute(result:history:dateOfBirth:chronoType:)`, which returns a `SleepScore` with `total`, `duration`, `quality`, and `routine` subscores (each 0.0–1.0). Build history entries from a completed result via `AnalysisResult.toSleepScoreHistoryEntry()` and derive the user's `ChronoType` with `SleepScoring.identifyChronoType(history:)`.
* **Extended audio events**: New `extendedAudioEvents` feature flag exposes additional `EventType` values beyond the standard set. `EventType.standardTypes` and `EventType.extendedTypes` group the available sets.
* **Real-time sleep staging in results**: `AnalysisResult` now includes `realTimeSleepStageIntervals`, the sleep stages emitted live during the session (in addition to the post-session `sleepStageIntervals`).

### API Changes

* The channel-aware start method is now `startMultiChannelAnalysis(channel:config:at:smartAlarmConfig:tag:)` and accepts a `smartAlarmConfig:` parameter.
* `stopAnalysis(channel:)` is now `stopAnalysis(sessionId:)`, stopping a session by its `UUID`.
* `resumeAnalysis()` now returns `[ResumedSession]` (session ID, channel, and smart alarm config per resumed session) instead of `[AnalysisChannel: UUID]`.
* Added `forceTokenRefresh: Bool` parameter to `initialize()` to force a fresh token fetch even if a cached token exists.
* Added `channelSeparationConfig: ChannelSeparationConfig` parameter to `startAnalysis(...)`, `startDataSource(...)`, and `resumeAnalysis(...)`.
* `AudioEventListener.onAudioAnalysisBatchCompleted(...)` now receives `audioProbability: [EventType: Float]`, the per-batch probability for each event type. The `rms: [Float]` parameter has been replaced by `dbSpl: [Float]`, providing A-weighted sound volume in dB SPL.
* `EventEndedInfo` now includes an `eventType: EventType` property.
* `AnalysisResult` now includes `timeZone: TimeZone` (captured at session start) and `realTimeSleepStageIntervals: [SleepStageInterval]`.
* The stream accessors (`eventStream`, `breathingRateStream`, `errorStream`, `sleepStageStream`, `audioHealthStream`, `stateStream`) and `currentState` are now `async` (`get async`).
* Renamed `SleepCycleSdkError.sessionAlreadyRunning` to `.channelAlreadyRunning`, and added `.featureNotEnabled(_:)`.
* Added `SleepCycleSdk.version` returning the SDK version string.

## Version 1.1.0

### New Features

* **Multi-channel analysis**: Analyze two channels simultaneously using stereo audio. New `startDataSource(using:eventListeners:)` / `stopDataSource()` methods separate the data source lifecycle from session lifecycles, with per-channel start via `startAnalysis(channel:config:at:tag:)` and per-session stop via `stopAnalysis(channel:at:)`.
* **Audio health monitoring**: New `audioHealthStream: AsyncStream<AudioHealthUpdate>` emits real-time audio input health status changes (`.healthy`, `.flatline`, `.missingInput`). `AudioStatistics` and `AudioHealthInterval` are included in the analysis result.
* **Session IDs on all public types**: `Event`, `BreathingRate`, `SleepStageInterval`, `AudioClip`, and `AudioHealthUpdate` now include a `sessionId: UUID` property to identify which session they belong to.

### API Changes

* `startAnalysis()` now returns a `UUID` identifying the session.
* Added `tag: String?` parameter to `startAnalysis()` for labeling sessions.
* `AudioEventListener.onAudioAnalysisBatchCompleted()` now includes a `sessionId: UUID` parameter.
* `AnalysisResult` now includes `sleepStageIntervals`, `audioStatistics`, and `sessionId` properties.
* Added `multiChannelAnalysis` to `SleepAnalysisFeatures`.
