Cosmos logo

Cosmos

Cosmos is a iOS music player totally free and open-source

iOSMusicGitHub
2025-09-25
62 likes

Product Introduction

  1. Cosmos Music Player is a native iOS audio player specializing in high-fidelity playback of FLAC, MP3, and WAV files, offering dual storage integration with iCloud Drive and local device storage. The application is built entirely in Swift using Apple's native frameworks, ensuring optimal performance across iPhones and iPads running iOS 18.5 or newer.
  2. The core value lies in providing audiophiles and casual listeners with a free, privacy-focused music solution that combines lossless audio support with intelligent cloud synchronization. Unlike subscription-based services, Cosmos operates as a standalone player that respects user ownership of music files while offering professional-grade features like ReplayGain normalization and embedded metadata extraction.

Main Features

  1. The player utilizes AVFoundation framework to deliver bit-perfect FLAC/WAV decoding with support for 24-bit/192kHz audio streams, coupled with MP3 playback using hardware-accelerated decoding. Audio processing includes real-time ReplayGain analysis (both track and album modes) and gapless playback implementation for uninterrupted listening.
  2. Dual storage architecture enables simultaneous management of music libraries across iCloud Drive (with automatic cross-device synchronization) and local storage (direct file system access), using GCD (Grand Central Dispatch) for background indexing and GRDB (SQLite wrapper) for metadata caching. Files are automatically detected in dedicated "Cosmos Music Player" directories within both storage locations.
  3. Siri Intent Framework integration provides voice control in English and French, supporting natural language commands like "Play my favorites on Cosmos" with fuzzy matching for playlist names. The implementation includes custom INMediaUserContext handling to maintain queue state across background/foreground transitions and device reboots.

Problems Solved

  1. Addresses iOS's limited native support for lossless audio formats by implementing direct FLAC/WAV decoding without transcoding, preserving original audio quality. The solution bypasses Apple's default audio stack limitations through custom AVAudioEngine configurations and manual sample rate matching.
  2. Targets users with large personal music collections (both local files and cloud-stored assets) who require offline-capable playback without subscription dependencies. The app specifically serves audiophiles needing advanced features like channel configuration detection (mono/stereo/multichannel) and bit-depth visualization.
  3. Solves cross-device synchronization challenges through iCloud Drive integration using NSFileCoordinator and NSMetadataQuery, ensuring conflict-free file management. A typical use case involves users maintaining a master library in iCloud while keeping device-specific playlists locally, with automatic merge strategies during initial setup.

Unique Advantages

  1. Differentiates from competitors like VLC or Foobar2000 Mobile through native SwiftUI integration offering system-consistent UI/UX and deep iOS ecosystem integration (including Shortcuts app support). Unlike web-wrapper music apps, Cosmos implements direct filesystem access without intermediary servers.
  2. Innovates with a hybrid artist information system combining Discogs API (for detailed discography data) and Spotify Web API (for biography/imagery), using a fallback mechanism that prioritizes response speed and data completeness. The cache layer stores artist profiles using Core Data with NSIncrementalStore for partial updates.
  3. Competes through "offline-first" architecture where all metadata extraction (ID3v2, Vorbis comments) and playback functionality operate without internet connectivity. Security advantages include zero user tracking and end-to-end encrypted iCloud synchronization using Apple's CloudKit with NSPersistentCloudKitContainer for database sync.

Frequently Asked Questions (FAQ)

  1. How does iCloud synchronization handle file conflicts? The app implements a timestamp-based conflict resolution strategy using NSFileVersion, prioritizing the most recent modification while preserving both copies in a "Conflicts" subdirectory. Users receive system notifications to manually resolve critical conflicts through an integrated file browser.
  2. Why are some artist biographies missing? Artist data requires an active internet connection for initial fetch, with cached results stored for 30 days (configurable in settings). Missing data may occur if both Discogs and Spotify APIs return empty responses, which users can override through the "Wrong artist?" manual search feature.
  3. Can Siri commands control playback on HomePod? While Siri intent handling is device-specific, playback can be extended to AirPlay 2 devices through AVAudioSession route management. The app supports voice commands for target device selection ("Play on Living Room Speaker") when configured with Apple Home ecosystem devices.

Subscribe to Our Newsletter

Get weekly curated tool recommendations and stay updated with the latest product news