$npx -y skills add MoizIbnYousaf/marketing-cli --skill add-sfxAdd a new sound effect to @remotion/sfx
| 1 | ## Prerequisites |
| 2 | |
| 3 | Sound effects must first be added to the [remotion.media](https://github.com/remotion-dev/remotion.media) repository. The source of truth is `generate.ts` in that repo. A sound effect must exist there before it can be added to `@remotion/sfx`. |
| 4 | |
| 5 | Sound effects must be: |
| 6 | - WAV format |
| 7 | - CC0 (Creative Commons 0) licensed |
| 8 | - Normalized to peak at -3dB |
| 9 | |
| 10 | ## Steps |
| 11 | |
| 12 | ### 1. Add to `remotion.media` repo (must be done first) |
| 13 | |
| 14 | In the `remotion-dev/remotion.media` repo: |
| 15 | |
| 16 | 1. Add the WAV file to the root of the repo |
| 17 | 2. Add an entry to the `soundEffects` array in `generate.ts`: |
| 18 | ```ts |
| 19 | { |
| 20 | fileName: "my-sound.wav", |
| 21 | attribution: |
| 22 | "Description by Author -- https://source-url -- License: Creative Commons 0", |
| 23 | }, |
| 24 | ``` |
| 25 | 3. Run `bun generate.ts` to copy it to `files/` and regenerate `variants.json` |
| 26 | 4. Deploy |
| 27 | |
| 28 | ### 2. Add the export to `packages/sfx/src/index.ts` |
| 29 | |
| 30 | Use camelCase for the variable name. Avoid JavaScript reserved words (e.g. use `uiSwitch` not `switch`). |
| 31 | |
| 32 | ```ts |
| 33 | export const mySound = 'https://remotion.media/my-sound.wav'; |
| 34 | ``` |
| 35 | |
| 36 | ### 3. Create a doc page at `packages/docs/docs/sfx/<name>.mdx` |
| 37 | |
| 38 | Follow the pattern of existing pages (e.g. `whip.mdx`). Include: |
| 39 | - Frontmatter with `image`, `title` (camelCase export name), `crumb: '@remotion/sfx'` |
| 40 | - `<AvailableFrom>` tag with the next release version |
| 41 | - `<PlayButton>` import and usage |
| 42 | - Description |
| 43 | - Example code using `@remotion/media`'s `<Audio>` component |
| 44 | - Value section with the URL in a fenced code block |
| 45 | - Duration section (fetch the file and use `afinfo` on macOS to get duration/format) |
| 46 | - Attribution section with source link and license |
| 47 | - See also section linking to related sound effects |
| 48 | |
| 49 | ### 4. Register in sidebar and table of contents |
| 50 | |
| 51 | - `packages/docs/sidebars.ts` — add `'sfx/<name>'` to the `@remotion/sfx` category items |
| 52 | - `packages/docs/docs/sfx/table-of-contents.tsx` — add a `<TOCItem>` with a `<PlayButton size={32}>` |
| 53 | |
| 54 | ### 5. Update the skills rule file |
| 55 | |
| 56 | Add the new URL to the list in `packages/skills/skills/remotion/rules/sfx.md`. |
| 57 | |
| 58 | ### 6. Build |
| 59 | |
| 60 | ```bash |
| 61 | cd packages/sfx && bun run make |
| 62 | ``` |
| 63 | |
| 64 | ## Naming conventions |
| 65 | |
| 66 | | File name | Export name | |
| 67 | |-----------|------------| |
| 68 | | `my-sound.wav` | `mySound` | |
| 69 | | `switch.wav` | `uiSwitch` (reserved word) | |
| 70 | | `page-turn.wav` | `pageTurn` | |
| 71 | |
| 72 | ## Version |
| 73 | |
| 74 | Use the current version from `packages/core/src/version.ts`. |
| 75 | For docs `<AvailableFrom>`, increment the patch version by 1. |