Ordered. Each task ends in a commit referencing [rb-audio-input], with
npm test and npm run lint green. Pure code first, browser code second, UI
last, so every step is testable as it lands.
src/audio/types.ts: AudioClip, InputErrorCode, InputError class
with the five messages from design §2.6.feat(audio): AudioClip type and InputError [rb-audio-input]src/audio/resample.ts: toMono, lowpassFir (windowed sinc, 63 taps,
Blackman, cutoff 7.2 kHz relative to source rate), resampleTo16k.test/resample.test.ts per design §3: passthrough, 48 kHz stereo
440 Hz, 44.1 kHz length, 6 kHz survives, 7.9 kHz attenuated.feat(audio): mono mix and 16 kHz resampler with tests [rb-audio-input]src/audio/decode.ts: decodeToClip(channels, sampleRate, source).test/decode.test.ts: every fixture round-trips with documented
duration and identical samples at 16 kHz.feat(audio): decodeToClip [rb-audio-input]src/audio/load.ts: loadFile(file) with the 50 MB gate, Web Audio
decode, AudioContext closed after use, errors mapped to InputError.feat(audio): loadFile via Web Audio [rb-audio-input]src/audio/record.ts: record({maxS, onTick, onDone, onError}) per
design §2.4: constraints, MediaRecorder, 100 ms ticks, wall-clock hard
stop, idempotent stop(), track cleanup, decode via the same path,
safety trim.feat(audio): microphone recording with 10 s hard stop [rb-audio-input]src/audio/player.ts: createPlayer(clip) with play, stop,
position, onEnded, dispose.feat(audio): clip player [rb-audio-input]src/state/useAudioInput.ts: the state machine from design §2.6, with
upload, startRecording, stopRecording, dismissError. Replaces
the clip on each new input; disposes the previous player.feat(state): useAudioInput [rb-audio-input]src/ui/UploadButton.tsx (hidden file input, accept="audio/*"),
RecordButton.tsx (record/stop with "7.3 / 10 s"), Player.tsx
(play/stop + "0:02 / 0:06"), StatusLine.tsx, InputScreen.tsx.src/App.tsx renders InputScreen. index.css: portrait layout,
48 px targets, error text style.feat(ui): input screen with upload, record and playback [rb-audio-input]./scripts/dev.sh, open http://localhost:5173 on Android Chrome.README.md status to "implemented, review pending".fix(audio|ui): ... [rb-audio-input].The review stage writes review.md with a numbered checklist from the PRD
acceptance criteria and the T9 findings. No fixes in that stage.
audio/.test/fixtures/after-cold.wav), one MP3 and one OGG: generate with
ffmpeg -i audio/"after cold.aac" after-cold.mp3 and ... after-cold.ogg
into the scratch dir, not the repo.head -c 60000000 /dev/urandom > big.wav (must be refused
by size before decode).