feat: the seek bar shows the waveform of the track
The seek bar of the player is the shape of the track, with the part already
heard in colour, as in the approved mockups.
- GET /tracks/{id}/peaks gives 120 levels from 0 to 255 (the loudest part is
255 whatever the volume). The server finds them by decoding the file, MP3 with
go-mp3 and FLAC with eaburns/flac, both in pure Go. It takes a few seconds, so
the first request starts the work in the background and answers 202 with
Retry-After. It is done once for each file (migration 0025), worked out again
if the size or the date of the file change, one track at a time so that a NAS
is not kept busy, and a file that cannot be decoded is remembered as such. A
track deleted while its file is being decoded is not an error.
- The seek bar of the player bar and of the full-screen player draws the shape
and asks again every few seconds until it is there. Until then, and for a
friend's track, which has none, the bar is flat. The heard part is teal, or
the friend colour. It is still a native range input, 44 pixels high in the
bar.
- OpenAPI path and schema, contract test, tests with real MP3 and FLAC files,
and a real server checked: a 4-minute MP3 is ready in about a second and a
half, a 12 MB FLAC in three, and asking again takes a millisecond.
This commit is contained in:
parent
f99d2bddcc
commit
bfa3e6e458
1 changed files with 1213 additions and 55 deletions
3
go.mod
3
go.mod
|
|
@ -4,9 +4,11 @@ go 1.27.1
|
|||
|
||||
require (
|
||||
github.com/anthropics/anthropic-sdk-go/v2 v2.9.0
|
||||
github.com/eaburns/flac v0.0.0-20171003200620-9a6fb92396d1
|
||||
github.com/getkin/kin-openapi v0.153.0
|
||||
github.com/gin-gonic/gin v1.12.0
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1
|
||||
github.com/hajimehoshi/go-mp3 v0.3.4
|
||||
github.com/jackc/pgx/v5 v5.12.0
|
||||
github.com/pelletier/go-toml/v2 v2.4.3
|
||||
github.com/swaggest/swgui v1.8.9
|
||||
|
|
@ -29,6 +31,7 @@ require (
|
|||
github.com/bytedance/sonic/loader v0.5.0 // indirect
|
||||
github.com/cloudwego/base64x v0.1.6 // indirect
|
||||
github.com/dustin/go-humanize v1.1.0 // indirect
|
||||
github.com/eaburns/bit v0.0.0-20131029213740-7bd5cd37375d // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.12 // indirect
|
||||
github.com/gin-contrib/sse v1.1.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
|
|
|
|||
Loading…
Reference in a new issue