Repository navigation
Games stage 3: clip endpoint and name that tune (MAD-783) - #61
Merged
Merged
Conversation
Clips are cut on the server with ffmpeg from the stream the speaker
plays: one pass per song, faded in and out, untagged MP3 under opaque
IDs, kept briefly in memory and served at GET
/rooms/{id}/games/clips/{clipId}. They start on the beat map's loudest
section, snapped to a bar, or a third in without one; only songs that
stream are clipped (MAD-792).
Name that tune stops the music and plays a clip of another song, 1s,
then 2s, then 4s, each released only when it plays. One answer each,
scored by which clip it came in on; choices from similar artists' songs,
or typed in hard mode with half for the artist. The reveal plays more
from the same spot, then the music resumes where it stopped. Tunes come
from tonight, the room's favorites or the DJ's new picks, and are cut a
song ahead. A host can start a set of 5 or 10 tunes with a board between,
counted once toward breaks per hour (MAD-793). ADR 0015 updated.
Start now returns a copy of the round rather than the live one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every device playing the room (speaker or listener) plays each clip as the round lists it, newest only, never late (MAD-792). Phones show which clip is playing, take one guess, and show the tune's cover at the reveal; the big screen has a clip meter, the tune's cover, and a set's board with the winner crowned. Settings pick where tunes come from, where clips are cut and hard mode, and hosts can start a set of 5 or 10 from the room menu (MAD-793). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 3 of Phase 10 (MAD-783): the server cuts short song clips, and name that tune runs on them. ADR 0015 has a new "Stage 3" section.
MAD-792 Clip endpoint
clipspackage: clips are cut on the server with ffmpeg from the same stream the speaker plays, using a newtranscode.Clipper.-map_metadata -1, no ID3, bitexact).GET /rooms/{id}/games/clips/{clipId}serves a clip to its room only. IDs are random, so the URL, the file and its tags never name the song. Clips stay in memory for 20 minutes; paired screens can fetch them too.quiz.ClipStartpicks where a clip starts:MAD-793 Name that tune
Break) and plays a clip of a different song: 1 s, then 2 s, then 4 s. Each clip's ID goes out only when it's time to play it. Every device playing the room (speaker or listener) plays each clip as it appears.already_answered, 409). A right answer scores 1000 on the first clip, 800 on the second and 600 after that.Question.Half).artworkendpoint now covers tunes) and plays 8 s more from the same spot. Then the music resumes where it stopped, if it was playing.games.tuneroom settings:from,typed,clip): tonight's songs, the room's favourites (played through, with a heart counting as two plays), or new DJ picks throughsuggest. If the chosen source has none, it tries the others. Recently used tunes don't come back.POST …/games/roundswithset). Tunes run back to back with the music stopped, and the set's board shows after each reveal.game_rounds.set_id).no_question.Also
Engine.Startnow returns a copy of the round. It used to return the live round, which the HTTP handler could read while timers were changing it (the race detector caught this).Not done here
Testing
go test -race ./...passes andgolangci-lintreports 0 issues. The clip tests run against real ffmpeg on the fake provider's WAV audio.ClipStart,NameTunewith half credit, the clips service, tune settings, and the HTTP clip endpoint (404 for other rooms)pnpm test,typecheck,lintandbuildall pass. I haven't played a tune end to end in a browser.🤖 Generated with Claude Code