[Feature]: Desktop app: music and Listen Together

オープン
#91 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
15/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust, typescript

調査の方向性

Read epic #80 and prerequisite issues #82 and #83 first, then compare the web player in web/src/music/, especially decoder.worker.ts, engine.ts, and listen.ts, with the shared queue logic in packages/shared/src/music.ts and its music.test.ts tests. The issue calls for a native desktop audio engine, player UI, queue synchronization, and Listen Together integration across several subsystems. Done means gapless playback, matching crossfade and ReplayGain behavior, shared queue continuity, and Listen Together compatibility with web members.

索引モデルが issue の本文から書いたものです。

説明

enhancement

[!NOTE]
This issue was written by Claude (Claude Opus 5.5) from a planning session with @PhrolovaMoe. Part of #80, builds on #82 and #83. Read the epic first.

Area

Desktop app

Problem

Music on the web is a fully custom, hi-fi player: untranscoded playback, sample-accurate gapless, crossfade and ReplayGain, a server-side queue shared with Subsonic clients, and Listen Together. The app needs the same thing natively, not through mpv.

Proposed solution
Engine
  • Decode with decoder/core (symphonia, gapless sequence, resampling to the output rate), exactly as the web worker does (web/src/music/decoder.worker.ts, engine.ts).
  • Read files through a Read + Seek adapter over HTTP Range requests on /api/music/tracks/{id}/file, with the same fallback the web uses (…/flac for lossless formats the decoder can't read, …/stream only when the user asks for lossy).
  • Output with cpal. On Linux that's the ALSA host, which reaches PipeWire/PulseAudio through their ALSA plugins. Use the device's default rate and follow the default device when it changes.
  • A lock-free ring between the decode thread and the cpal callback, like the web's ring.ts/worklet.ts. The position comes from frames actually played, as on web.
  • ReplayGain Off/Track/Album/Auto (default Auto), crossfade (off by default, never between consecutive tracks of the same album), and volume, all as on web.
Player logic
  • Port packages/shared/src/music.ts (queue, repeat/shuffle, keeping the server's play queue in step) to Rust, with its tests (music.test.ts) ported too. Behaviour must match, because web, Android and Subsonic clients share the server's queue. Send the client argument on nowPlaying/savePlayQueue as the other apps do.
  • Starting a video, clip or room pauses music and hides the pill; leaving it brings the pill back paused. The pill can only be closed while paused. The queue persists. All as on web.
UI

The web is the spec (web/src/music/):

  • Library (Albums / Artists / Songs / Playlists) in the sidebar's music library, routes/album.$id.tsx, artist.$id.tsx, playlist.$id.tsx.
  • The bottom-centre pill → floating card → full-screen Now Playing (Lyrics / Queue / Info) with synced lyrics, tinted from the artwork (Pill.tsx, NowPlaying.tsx, controls.tsx, components.tsx).
  • Stars, ratings, playlists, history: the same mutations.
Listen Together

Port web/src/music/listen.ts and routes/listen.$code.tsx: the listen WebSocket (/api/listen/{code}/ws), the room's routes for files/covers/avatars, guests without sign-in, and joining from tinystream://<host>/listen/<code> and web URLs (the entry point is called by #92).

MPRIS for music is wired in #92. Expose the player state it needs (metadata, art URL, position, rate, controls).

Done when

An album with gapless transitions plays without a gap or click. Crossfade and ReplayGain sound the same as on web. The queue picked up on web continues in the app and the other way round. Listen Together works with web members. CPU use while playing is low (well under a browser tab playing the same).

主要言語
TypeScript
スター
4
フォーク
1
平均マージ
4時間 49分
マージ済み PR(30日)
5

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tinystream-dev/tinystream のほかの issue

tinystream-dev/tinystream の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。