feat: Audio Preview Player — play WAV samples directly in the browser #9

Closed
opened 2026-06-22 02:38:18 +00:00 by david · 1 comment
Owner

Feature: Audio Preview Player

As a sample browser
I want to preview WAV samples by clicking them in the web UI
So that I can audition sounds before downloading or extracting

Acceptance Criteria

Scenario: Play a sample from extracted WAVs

Given extracted WAV files in ./output/wavs/
When I open the WAV browser in the UI and click "Play" on SINE.WAV
Then the audio plays immediately using the Web Audio API
And a waveform or progress bar shows playback position

Scenario: Play a sample from the Disk Browser

Given an AKAI disk image loaded in the Disk Browser
When I click a sample file (e.g. "KICK.S")
Then the server extracts that single sample to a temp WAV
And streams it to the browser for playback via AudioContext
And the temp file is cleaned up when playback stops

Scenario: Sequential playback

Given a volume with multiple samples
When I click "Play All" or press Space
Then each sample plays in sequence with a configurable gap
And the UI highlights the currently playing sample

Implementation

  • Use Web Audio API (AudioContext + AudioBuffer) — no external deps, follows project no-dependency principle
  • Endpoint: GET /api/wav-preview?iso=&file= — streams a temp WAV
  • For extracted WAVs: serve directly via existing HTTP file serving
  • Auto-cleanup temp WAVs after 5 min idle via server-side timer
  • akaiutil single-sample extract: sample2wavi <idx> targeting /tmp

Karpathy Principle

Play from extracted WAVs first (zero new server code). Then add per-sample extraction from disk images as a second iteration.

## Feature: Audio Preview Player **As a** sample browser **I want to** preview WAV samples by clicking them in the web UI **So that** I can audition sounds before downloading or extracting ### Acceptance Criteria **Scenario: Play a sample from extracted WAVs** ``` Given extracted WAV files in ./output/wavs/ When I open the WAV browser in the UI and click "Play" on SINE.WAV Then the audio plays immediately using the Web Audio API And a waveform or progress bar shows playback position ``` **Scenario: Play a sample from the Disk Browser** ``` Given an AKAI disk image loaded in the Disk Browser When I click a sample file (e.g. "KICK.S") Then the server extracts that single sample to a temp WAV And streams it to the browser for playback via AudioContext And the temp file is cleaned up when playback stops ``` **Scenario: Sequential playback** ``` Given a volume with multiple samples When I click "Play All" or press Space Then each sample plays in sequence with a configurable gap And the UI highlights the currently playing sample ``` ### Implementation - Use Web Audio API (AudioContext + AudioBuffer) — no external deps, follows project no-dependency principle - Endpoint: GET /api/wav-preview?iso=<path>&file=<path> — streams a temp WAV - For extracted WAVs: serve directly via existing HTTP file serving - Auto-cleanup temp WAVs after 5 min idle via server-side timer - `akaiutil` single-sample extract: `sample2wavi <idx>` targeting /tmp ### Karpathy Principle Play from extracted WAVs first (zero new server code). Then add per-sample extraction from disk images as a second iteration.
david added the featureweb-ui labels 2026-06-22 02:38:18 +00:00
Author
Owner

Infrastructure is now in place on main:

  • Web UI with vanilla JS frontend
  • fetch serve HTTP server can serve extracted WAV files directly
  • Electron shell for desktop packaging

Ready to implement: Web Audio API playback from already-extracted WAVs first (zero new server code). Then add /api/wav-preview for per-sample extraction from disk images with auto-cleanup.

Infrastructure is now in place on main: - Web UI with vanilla JS frontend - fetch serve HTTP server can serve extracted WAV files directly - Electron shell for desktop packaging Ready to implement: Web Audio API playback from already-extracted WAVs first (zero new server code). Then add /api/wav-preview for per-sample extraction from disk images with auto-cleanup.
david closed this issue 2026-06-22 09:25:29 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: david/akai-utils#9