Skip to content

Send song_seconds on conversion_succeeded (2.3.5) - #70

Merged
liladas merged 1 commit into
mainfrom
song-seconds-analytics
Jul 22, 2026
Merged

liladas merged 1 commit into
mainfrom
song-seconds-analytics

Conversation

@liladas

@liladas liladas commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Problem

The event taxonomy in docs/feedback-and-analytics.md specifies conversion_succeeded { resolution, duration_ms, song_seconds, output_mb_bucket }, but song_seconds was never wired into trackConversionSucceeded or its call site. Every event to date has shipped without it, so there is no song-length data: a 16-minute duration_ms cannot be split into slow hardware vs. long track.

Change

  • cdgSongSeconds(bytes) in src/lib/analytics.ts: song length in whole seconds derived from the CDG stream (300 packets/sec x 24 bytes = 7200 bytes/sec). No audio decoding. This measures the graphics duration; since Hold the last CDG frame instead of ending the video at the graphics end (2.3.4) #69 the output runs to the usually slightly longer MP3 length, which is close enough to characterize song length.
  • Converter.tsx passes song_seconds: cdgSongSeconds(pair.cdg.byteLength) on conversion_succeeded, and the tracker type now requires it.
  • Unit tests for the new helper.
  • Version bump to 2.3.5.

Applies from this build forward; historical events remain without the property.

Verification

  • vitest 82/82, tsc -b clean, eslint clean (3 pre-existing warnings), prettier clean, Playwright e2e 5/5

The event taxonomy in docs/feedback-and-analytics.md specifies a
song_seconds property on conversion_succeeded, but it was never wired:
every event to date has shipped without it, so there is no song-length
data to separate slow hardware from long tracks in duration_ms.

Derive it from the CDG stream (300 packets/sec x 24 bytes = 7200
bytes/sec), which measures the graphics duration without decoding the
MP3. The output video runs to the usually slightly longer audio length,
but this is close enough to characterize song length.
@liladas
liladas merged commit bb1518d into main Jul 22, 2026
@liladas
liladas deleted the song-seconds-analytics branch July 23, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant