Plan: Tidal Integration for SMoC
1. Product Requirements
Background & Relevance
Tidal is the premier service for high-fidelity audio. SMoC users who value terminal minimalist UI often overlap with audiophiles who appreciate Tidal's FLAC and Master quality streams. Supporting Tidal positions SMoC as a "Hi-Fi CLI Player."
Feature Scope
- High-Quality Playback: Support for AAC and Lossless FLAC streams.
- Device Authentication: Implementation of the "Device Code" OAuth flow (best for terminal apps without a browser).
- Library Management: Access to user's "My Collection" (Artists, Albums, Playlists).
2. Technical Implementation Plan
Architecture Overview
Tidal uses a complex OAuth-based authentication system. The TidalStreamingClient will need to handle persistent tokens and refresh cycles.
Proposed Code Changes
1. Configuration (Smoc.Configuration)
- Create
TidalConfig.cs:
ClientId / ClientSecret: Required for OAuth.
AccessToken / RefreshToken: Stored securely to avoid re-auth.
QualitySetting: (Low, High, Lossless).
2. Streaming Client (Smoc.Streaming.Tidal)
TidalStreamingClient.cs:
- Implement
IStreamingClient.
- Authentication: Implement the
device/authorization flow.
- Metadata: Use Tidal's
/tracks, /albums, and /artists endpoints.
- Playback: Call the
/playbackinfo endpoint to receive the stream manifest. Tidal provides streams in encrypted/protected formats, but standard AAC/FLAC URLs are available for standard API clients.
Libraries & Dependencies
- System.Net.Http: For REST API calls.
- Newtonsoft.Json or System.Text.Json: For complex manifest parsing.
Implementation Milestones
- OAuth Handshake: Implement the terminal-based "Go to this URL and enter code" flow.
- Catalog Browsing: Map Tidal's rich metadata to SMoC entities.
- Lossless Streaming: Ensure
SoundFlow is configured to handle FLAC streams from Tidal.
- Listen History: Implement scrobbling to Tidal's history service.
3. Future Considerations
- MQA Support: (Low priority) Handling Master Quality Authenticated streams if required.
Plan: Tidal Integration for SMoC
1. Product Requirements
Background & Relevance
Tidal is the premier service for high-fidelity audio. SMoC users who value terminal minimalist UI often overlap with audiophiles who appreciate Tidal's FLAC and Master quality streams. Supporting Tidal positions SMoC as a "Hi-Fi CLI Player."
Feature Scope
2. Technical Implementation Plan
Architecture Overview
Tidal uses a complex OAuth-based authentication system. The
TidalStreamingClientwill need to handle persistent tokens and refresh cycles.Proposed Code Changes
1. Configuration (
Smoc.Configuration)TidalConfig.cs:ClientId/ClientSecret: Required for OAuth.AccessToken/RefreshToken: Stored securely to avoid re-auth.QualitySetting: (Low, High, Lossless).2. Streaming Client (
Smoc.Streaming.Tidal)TidalStreamingClient.cs:IStreamingClient.device/authorizationflow./tracks,/albums, and/artistsendpoints./playbackinfoendpoint to receive the stream manifest. Tidal provides streams in encrypted/protected formats, but standard AAC/FLAC URLs are available for standard API clients.Libraries & Dependencies
Implementation Milestones
SoundFlowis configured to handle FLAC streams from Tidal.3. Future Considerations