Skip to main content

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.

Version 1.1.1

New Features

  • Smart alarm: Configure a wake-up window via SmartAlarmConfig and observe alarm lifecycle events (Armed, Triggered) through the new smartAlarmFlow: SharedFlow<SmartAlarmEvent>. Trigger reasons include OPTIMAL_WAKE_UP, USER_INTERACTION, and WINDOW_END. Smart alarm is gated behind SleepAnalysisFeatures.smartAlarm 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 BED_SIDE_MICS, CENTERED_MIC_ARRAY, and DETECTION_STRENGTH_ONLY.

API Changes

  • Added smartAlarmConfig: SmartAlarmConfig? parameter to startAnalysis() and startMultiChannelAnalysis().
  • Added channelSeparationConfig: ChannelSeparationConfig parameter to startAnalysis(), startDataSource(), and resumeAnalysis().
  • Added forceTokenRefresh: Boolean parameter to initialize() to force a fresh token fetch even if a cached token exists.
  • resumeAnalysis() now returns List<ResumedSession> instead of Boolean, providing session ID, channel, and smart alarm config for each resumed session.
  • createLiveDataSource() now enables the gyroscope when the accelerometer is enabled.
  • stopDataSource() and stopAnalysis() no longer throw when the SDK is not initialized; they return gracefully instead.

Version 1.1.0

New Features

  • Multi-channel analysis: Analyze two channels simultaneously using stereo audio. New startDataSource() / stopDataSource() methods separate the data source lifecycle from session lifecycles, with per-channel start via startMultiChannelAnalysis(channel:) and per-session stop via stopAnalysis(sessionId:).
  • Audio health monitoring: New audioHealthFlow: SharedFlow<AudioHealthUpdate> emits real-time audio input health status changes (HEALTHY, FLATLINE, MISSING_INPUT). 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.

Version 1.0.10

Released: January 26, 2026

New Features

  • Disk space checking: The SDK now checks for sufficient disk space before starting analysis and throws SdkNotEnoughDiskSpaceException if there is insufficient space available.

API Changes

  • Added SdkNotInitializedException exception thrown when SDK methods are called before initialization.
  • Added @throws documentation for SdkNotInitializedException and SdkNotEnoughDiskSpaceException on startAnalysis().

Bug Fixes

  • Improved error handling when writing to the database to prevent crashes on low disk space.

Version 1.0.9

Released: January 15, 2026

New Features

  • Preferred audio device: Added ability to specify a preferred audio input device via the preferredDevice parameter in createLiveDataSource().

API Changes

  • Added support for stereo audio input.
  • The dataSource parameter in startAnalysis() and resumeAnalysis() is now mandatory (non-nullable) with a default value of createLiveDataSource().
  • Added createLiveDataSource() factory method for creating a live data source that captures from device sensors.
  • Made LiveDataSource class public, allowing direct instantiation for custom configurations.
  • Extended DataSource interface with new methods:
    • audioOutputEnabled() - Check if audio output is enabled
    • accelerometerOutputEnabled() - Check if accelerometer output is enabled
    • getAudioFormat() - Returns the audio channel configuration (MONO or STEREO)
  • Published artifact now includes source files (excluding internal package) for easier debugging.