Skip to content

Repository files navigation

Spotify WatchOS App

A comprehensive Spotify app for Apple Watch that provides music playback, downloading, DJ features, playlist management, and device control - all onboard without requiring a phone app.

Features

🎵 Music Playbook

  • Stream music directly from Spotify API
  • Local audio playback with AVAudioPlayer
  • Now Playing interface with album art
  • Playback controls (play, pause, skip, previous)
  • Progress tracking and seek functionality
  • Volume control

📱 Device Control

  • Volume adjustment
  • Shuffle and repeat modes
  • Device selection for Spotify Connect
  • Connection status monitoring
  • Quick actions (like, download, share)

💾 Music Downloads

  • Download tracks for offline listening
  • Local storage management
  • Downloaded tracks library
  • Automatic cleanup and organization

🎧 DJ Features

  • Dual deck interface (A/B)
  • Crossfader control
  • BPM detection and sync
  • Audio effects (filter, reverb, echo, flanger)
  • Loop controls with beat-based loops
  • Cue points for precise mixing

📋 Playlist Management

  • Browse Spotify playlists
  • View playlist details
  • Track selection and playback
  • Playlist navigation

Setup

Prerequisites

  1. Xcode 15.0 or later
  2. Apple Watch with watchOS 10.0 or later
  3. Spotify Premium account
  4. Spotify Developer App credentials

Spotify API Setup

  1. Go to Spotify Developer Dashboard
  2. Create a new app
  3. Note your Client ID and Client Secret
  4. Add spotifywatch://callback to redirect URIs
  5. Update the credentials in SpotifyAPI.swift:
    private let clientID = "YOUR_SPOTIFY_CLIENT_ID"
    private let clientSecret = "YOUR_SPOTIFY_CLIENT_SECRET"

Build and Run

  1. Open SpotifyWatchApp.xcodeproj in Xcode
  2. Select your Apple Watch as the target device
  3. Build and run the project

Architecture

Core Components

  • SpotifyAPI: Handles authentication, API calls, and data management
  • MusicPlayer: Manages audio playback, downloads, and local storage
  • DJController: Provides DJ functionality and effects
  • ContentView: Main tab-based navigation interface

Views

  • LoginView: Spotify authentication
  • NowPlayingView: Current track display and basic controls
  • PlaylistsView: Browse and select playlists
  • DJView: Professional DJ controls and effects
  • DownloadsView: Manage offline music library
  • ControlsView: Device settings and quick actions

API Integration

The app integrates with Spotify Web API endpoints:

  • Authentication (OAuth 2.0)
  • User profile and playlists
  • Playback control
  • Currently playing track
  • Search and browse

Local Storage

  • Downloaded tracks stored in Documents/Music/
  • User preferences in UserDefaults
  • Playlist cache for offline browsing
  • Authentication tokens securely stored

Privacy and Security

  • Spotify credentials are not hardcoded (placeholder values provided)
  • User tokens stored securely in UserDefaults
  • Audio files are stored locally and managed properly
  • No unauthorized data sharing

Known Limitations

  1. Actual Audio Streaming: This implementation uses placeholder URLs. Real Spotify streaming requires Spotify SDK integration
  2. Premium Features: Some features require Spotify Premium subscription
  3. Device Limitations: Watch hardware limitations may affect audio quality and battery life
  4. Network Dependency: Initial authentication and playlist loading require internet connection

Future Enhancements

  • Spotify SDK integration for real audio streaming
  • Advanced DJ effects with Core Audio
  • Social features and sharing
  • Apple HealthKit integration for workout music
  • Voice control with Siri integration
  • WatchKit complications for quick access

License

This project is for educational purposes. Spotify integration requires proper licensing and API agreements.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages