Orange Music Player
A modern, native music player for macOS built with SwiftUI and SFBAudioEngine, featuring high-quality audio playback, dynamic theming, and an intuitive interface.
// Overview
Orange Music Player is a native macOS music player designed for audiophiles who want high-quality playback with a beautiful, modern interface. Built entirely in Swift using SwiftUI, it offers seamless integration with the macOS ecosystem.
The player supports a wide range of audio formats including FLAC, MP3, AAC, ALAC, WAV, and AIFF, with automatic metadata extraction for title, artist, album, year, and track number.
// Architecture
The app follows an MVVM architecture with SwiftUI's declarative views driven by observable view models. The audio pipeline is completely decoupled from the UI layer, allowing smooth playback even during heavy UI updates.
// Key Features
- High-quality audio playback via SFBAudioEngine
- Crossfade between tracks (adjustable 1-10 seconds)
- Gapless playback for seamless listening
- Shuffle and repeat modes
- Audio output device selection
- Browse by Albums, Artists, or Songs
- Create and manage playlists
- Mark favorite tracks
- Recently Played and Frequently Played sections
- Global search across tracks, albums, and artists
- Dynamic color theming based on album artwork
// Technical Details
SwiftUI: The entire UI is built with SwiftUI, providing a responsive and native macOS experience with smooth animations and modern design patterns.
SFBAudioEngine: Leverages this powerful audio framework for high-fidelity playback, supporting a wide range of audio formats and providing precise control over audio output.
Keyboard Shortcuts: Full keyboard support including Space for play/pause, Command+Arrow keys for track navigation, and more for power users.
// Challenges & Solutions
Challenge: Implementing gapless playback and crossfade without audio glitches or memory spikes when transitioning between tracks.
Solution: Used SFBAudioEngine's native crossfade support with pre-buffered next-track loading. The audio pipeline maintains two active decoders during transitions, with memory-mapped file access to keep resource usage minimal.
Challenge: Extracting dominant colors from album artwork in real-time for dynamic UI theming without blocking the main thread.
Solution: Leveraged Core Image's CIAreaAverage filter on a background queue with downsampled artwork. Colors are cached per-album in the SQLite database, so subsequent loads are instant.
// What I'd Improve
- Add AirPlay and Bluetooth streaming support
- Implement audio visualization and equalizer
- Add Last.fm scrobbling integration
- Build an iOS companion app