Version 1.2.0
New Features
- Smart alarm: Configure a wake-up window via
SmartAlarmConfigand observe alarm lifecycle events through the newsmartAlarmStream: AsyncStream<SmartAlarmEvent>. Event types are.armedand.triggered(reason), with reasons.optimalWakeUp,.userInteraction, and.windowEnd. Smart alarm is gated behind thesmartAlarmfeature and only supported on the primary channel. - Stereo channel separation: New
ChannelSeparationConfigcontrols how stereo audio channels are assigned to analysis channels, with built-in presets.bedSideMics,.centeredMicArray, and.detectionStrengthOnly. - Configurable audio input: New
AudioInputConfigselects the audio format (mono/stereo) and a preferred input device when creating a live data source viacreateLiveDataSource(audioConfig:). - Sleep score: Compute a per-night sleep score with
SleepScoring.compute(result:history:dateOfBirth:chronoType:), which returns aSleepScorewithtotal,duration,quality, androutinesubscores (each 0.0–1.0). Build history entries from a completed result viaAnalysisResult.toSleepScoreHistoryEntry()and derive the user’sChronoTypewithSleepScoring.identifyChronoType(history:). - Extended audio events: New
extendedAudioEventsfeature flag exposes additionalEventTypevalues beyond the standard set.EventType.standardTypesandEventType.extendedTypesgroup the available sets. - Real-time sleep staging in results:
AnalysisResultnow includesrealTimeSleepStageIntervals, the sleep stages emitted live during the session (in addition to the post-sessionsleepStageIntervals).
API Changes
- The channel-aware start method is now
startMultiChannelAnalysis(channel:config:at:smartAlarmConfig:tag:)and accepts asmartAlarmConfig:parameter. stopAnalysis(channel:)is nowstopAnalysis(sessionId:), stopping a session by itsUUID.resumeAnalysis()now returns[ResumedSession](session ID, channel, and smart alarm config per resumed session) instead of[AnalysisChannel: UUID].- Added
forceTokenRefresh: Boolparameter toinitialize()to force a fresh token fetch even if a cached token exists. - Added
channelSeparationConfig: ChannelSeparationConfigparameter tostartAnalysis(...),startDataSource(...), andresumeAnalysis(...). AudioEventListener.onAudioAnalysisBatchCompleted(...)now receivesaudioProbability: [EventType: Float], the per-batch probability for each event type. Therms: [Float]parameter has been replaced bydbSpl: [Float], providing A-weighted sound volume in dB SPL.EventEndedInfonow includes aneventType: EventTypeproperty.AnalysisResultnow includestimeZone: TimeZone(captured at session start) andrealTimeSleepStageIntervals: [SleepStageInterval].- The stream accessors (
eventStream,breathingRateStream,errorStream,sleepStageStream,audioHealthStream,stateStream) andcurrentStateare nowasync(get async). - Renamed
SleepCycleSdkError.sessionAlreadyRunningto.channelAlreadyRunning, and added.featureNotEnabled(_:). - Added
SleepCycleSdk.versionreturning 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 viastartAnalysis(channel:config:at:tag:)and per-session stop viastopAnalysis(channel:at:). - Audio health monitoring: New
audioHealthStream: AsyncStream<AudioHealthUpdate>emits real-time audio input health status changes (.healthy,.flatline,.missingInput).AudioStatisticsandAudioHealthIntervalare included in the analysis result. - Session IDs on all public types:
Event,BreathingRate,SleepStageInterval,AudioClip, andAudioHealthUpdatenow include asessionId: UUIDproperty to identify which session they belong to.
API Changes
startAnalysis()now returns aUUIDidentifying the session.- Added
tag: String?parameter tostartAnalysis()for labeling sessions. AudioEventListener.onAudioAnalysisBatchCompleted()now includes asessionId: UUIDparameter.AnalysisResultnow includessleepStageIntervals,audioStatistics, andsessionIdproperties.- Added
multiChannelAnalysistoSleepAnalysisFeatures.