← Recipe: play packaged audio

2. Replace luastra.json

luastra/media · live media_state events · about 20 minutes
asset + media.command + ui.render

The manifest admits both the packaged bytes and the host capability that controls playback.

When to use it

Replace the generated manifest after copying the WAV file. A source path alone is not a playable or portable asset reference.

Focused example

{
  "schemaVersion": 2,
  "project": { "id": "dev.luastra.media-recipe", "entry": "app/main" },
  "sdk": { "contract": 1 },
  "capabilities": ["media.command", "ui.render"],
  "assets": [
    {
      "id": "audio/focus",
      "source": "assets/focus.wav",
      "mediaType": "audio/wav"
    }
  ],
  "modules": [
    {
      "id": "app/main",
      "source": "src/main.luau",
      "dependencies": ["luastra/app", "luastra/assets", "luastra/media", "luastra/ui"]
    },
    {
      "id": "app/tests/media",
      "source": "tests/smoke.luau",
      "dependencies": ["app/main", "luastra/media"]
    }
  ],
  "tests": ["app/tests/media"]
}

Complete inventory

View all pages in Recipe: play packaged audio
← Previous: 1. Create the project and copy audioNext: 3. Replace src/main.luau →