Skip to content

P5-01: Audio file slot #14

@socialawy

Description

@socialawy

Summary

Add a single audio track reference to the sequence spec and Composer UI, allowing users to attach an audio file to their sequence.

Acceptance Criteria

  • Schema extension: Add audio field to sequence.json schema:
    "audio": {
      "src": "string",
      "offset": 0,
      "volume": 1.0
    }
    • src: filename/reference to audio file
    • offset: seconds into the sequence where audio starts (default 0)
    • volume: 0.0–1.0 (default 1.0)
    • Field is optional (sequences without audio remain valid)
  • Composer UI: Audio slot panel with:
    • File picker accepting .mp3, .wav, .ogg
    • Display of selected file name
    • Remove audio button
  • IndexedDB storage: Audio file stored as Blob in IndexedDB alongside the project (uses persistence from P5-10)
  • Waveform visualization: Canvas2D waveform display in the timeline area showing the audio shape
  • Mute/unmute toggle in the audio panel

Tests (Vitest)

  • Schema validation passes with audio field present
  • Schema validation passes without audio field (backward compatible)
  • Audio file loading: mock file → stored as blob → retrievable
  • Volume defaults to 1.0, offset defaults to 0 when not specified
  • Waveform renderer receives correct audio data

Architecture Notes

  • src/spec/ — Schema definition + validation for the audio field
  • src/composer/ — Audio slot panel UI, waveform Canvas2D component
  • src/store/ — Audio state in Zustand store + IndexedDB blob persistence
  • Waveform uses Canvas2D (consistent with existing renderer approach)

Dependencies

Priority

Phase 5, Item 01 — Jules priority queue position: 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions