add-sfx
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrerequisites
前提条件
Sound effects must first be added to the remotion.media repository. The source of truth is in that repo. A sound effect must exist there before it can be added to .
generate.ts@remotion/sfxSound effects must be:
- WAV format
- CC0 (Creative Commons 0) licensed
- Normalized to peak at -3dB
音效必须满足以下要求:
- WAV格式
- CC0(知识共享零许可协议)授权
- 归一化处理,峰值为-3dB
Steps
步骤
1. Add to remotion.media
repo (must be done first)
remotion.media1. 先添加到remotion.media仓库(必须优先完成)
In the repo:
remotion-dev/remotion.media- Add the WAV file to the root of the repo
- Add an entry to the array in
soundEffects:generate.tsts{ fileName: "my-sound.wav", attribution: "Description by Author -- https://source-url -- License: Creative Commons 0", }, - Run to copy it to
bun generate.tsand regeneratefiles/variants.json - Deploy
在仓库中:
remotion-dev/remotion.media- 将WAV文件添加到仓库根目录
- 在的
generate.ts数组中添加一条条目:soundEffectsts{ fileName: "my-sound.wav", attribution: "Description by Author -- https://source-url -- License: Creative Commons 0", }, - 运行将文件复制到
bun generate.ts目录并重新生成files/variants.json - 部署
2. Add the export to packages/sfx/src/index.ts
packages/sfx/src/index.ts2. 将导出添加到packages/sfx/src/index.ts
packages/sfx/src/index.tsUse camelCase for the variable name. Avoid JavaScript reserved words (e.g. use not ).
uiSwitchswitchts
export const mySound = 'https://remotion.media/my-sound.wav';变量名使用小驼峰命名法。避免使用JavaScript保留字(例如,使用而非)。
uiSwitchswitchts
export const mySound = 'https://remotion.media/my-sound.wav';3. Create a doc page at packages/docs/docs/sfx/<name>.mdx
packages/docs/docs/sfx/<name>.mdx3. 在packages/docs/docs/sfx/<name>.mdx
创建文档页面
packages/docs/docs/sfx/<name>.mdxFollow the pattern of existing pages (e.g. ). Include:
whip.mdx- Frontmatter with ,
image(camelCase export name),titlecrumb: '@remotion/sfx' - tag with the next release version
<AvailableFrom> - import and usage
<PlayButton> - Description
- Example code using 's
@remotion/mediacomponent<Audio> - Value section with the URL in a fenced code block
- Duration section (fetch the file and use on macOS to get duration/format)
afinfo - Attribution section with source link and license
- See also section linking to related sound effects
遵循现有页面的格式(例如),内容应包含:
whip.mdx- 带有、
image(小驼峰导出名称)、title的前置元数据crumb: '@remotion/sfx' - 包含下一个发布版本号的标签
<AvailableFrom> - 的导入与使用示例
<PlayButton> - 描述信息
- 使用的
@remotion/media组件的示例代码<Audio> - 包含URL的代码块(值部分)
- 时长部分(获取文件后,在macOS上使用获取时长/格式)
afinfo - 包含来源链接和许可证的署名部分
- 链接到相关音效的“另请参阅”部分
4. Register in sidebar and table of contents
4. 在侧边栏和目录中注册
- — add
packages/docs/sidebars.tsto the'sfx/<name>'category items@remotion/sfx - — add a
packages/docs/docs/sfx/table-of-contents.tsxwith a<TOCItem><PlayButton size={32}>
- — 将
packages/docs/sidebars.ts添加到'sfx/<name>'分类的项目中@remotion/sfx - — 添加一个包含
packages/docs/docs/sfx/table-of-contents.tsx的<PlayButton size={32}><TOCItem>
5. Update the skills rule file
5. 更新技能规则文件
Add the new URL to the list in .
packages/skills/skills/remotion/rules/sfx.md在的列表中添加新URL。
packages/skills/skills/remotion/rules/sfx.md6. Build
6. 构建
bash
cd packages/sfx && bun run makebash
cd packages/sfx && bun run makeNaming conventions
命名规范
| File name | Export name |
|---|---|
| |
| |
| |
| 文件名 | 导出名 |
|---|---|
| |
| |
| |
Version
版本
Use the current version from .
For docs , increment the patch version by 1.
packages/core/src/version.ts<AvailableFrom>使用中的当前版本。
对于文档中的,将补丁版本号加1。
packages/core/src/version.ts<AvailableFrom>