Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

feat(editor): integrate sound event authoring

yhh9273f4f90682
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7f1abeca6..bcfe0d358 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,7 +16,9 @@ published separately; it ships inside the editor.
### Added
-- **Sound event sources share code and graph triggers.** SoundEventSource references the same validated event assets as SoundEvents; script graphs, FSM hooks and BT actions expose trigger/stop verbs. Same-frame triggers retain their order, cold definitions retain at most 256 intents per source, and source lifetime checks cancel stale definitions and clips after edits, removal, disable, Stop All or teardown. Scene preload, inspector pickers, UUID projection and export dependencies use the shared asset metadata. Dedicated event authoring and continuous preview remain in progress.
+- **Sound events have a dedicated authoring panel.** Create from audio selections or the Content Browser, drag in variants, reorder and edit weights/ranges with shared undo, save, reload and workspace handling. Continuous preview uses the runtime event manager and existing mixer/voice pool, showing the sampled clip and parameters alongside the shared waveform. A bounded peak cache avoids repeated waveform decoding and invalidates on disk/project changes.
+
+- **Sound event sources share code and graph triggers.** SoundEventSource references the same validated event assets as SoundEvents; script graphs, FSM hooks and BT actions expose trigger/stop verbs. Same-frame triggers retain their order, cold definitions retain at most 256 intents per source, and source lifetime checks cancel stale definitions and clips after edits, removal, disable, Stop All or teardown. Scene preload, inspector pickers, UUID projection and export dependencies use the shared asset metadata.
- **Sound event playback owns pending and paused voices.** The per-App SoundEvents resource loads owned emitters, shares event concurrency and cooldown before clip IO, and routes selected clips through the existing Audio priority pool. Natural completion, Stop All, owner despawn, registry disconnect and App cleanup release receipts and cancel late starts. Requests expose selected parameters, lifecycle and rejection reasons; spatial events reuse source attenuation/panning. Pending admissions avoid rescanning the loading queue, and unchanged gains skip backend writes.
@@ -24,6 +26,8 @@ published separately; it ships inside the editor.
### Fixed
+- **Asset documents retain edits made during a save.** A completed JSON write only marks the document clean if its asset and path still match the written snapshot. Pending file opens are also invalidated when the project changes.
+
- **Mixer bus edits retain the project's voice budget.** Adding, changing or removing a bus preserves the other audio settings, including an explicit unlimited voice count, instead of silently restoring the runtime default limit.
- **Unchanged 2D joints retain their solver state.** Paused collision edits, full mutation-history refreshes and identical joint writes preserve existing constraints instead of destroying and recreating them. Missing solver joints recover on reconciliation, changes to the live Canvas scale rebuild joint dimensions, and older cores observe joint writes after a previous physics run in the same tick. All six joint types retain their enabled and partner-lifetime behavior.
diff --git a/desktop b/desktop
index 1022aabd0..3ac1f6513 160000
--- a/desktop
+++ b/desktop
@@ -1 +1 @@
-Subproject commit 1022aabd027441cc4b0e1c2583671300e9aa84d1
+Subproject commit 3ac1f6513bc2958c2c60a32101dec524cde3758e
diff --git a/docs/astro/src/content/docs/assets/audio.mdx b/docs/astro/src/content/docs/assets/audio.mdx
index 87facb296..95166209d 100644
--- a/docs/astro/src/content/docs/assets/audio.mdx
+++ b/docs/astro/src/content/docs/assets/audio.mdx
@@ -119,7 +119,34 @@ Spatial events reuse AudioSource attenuation and panning; provide an owner with
world transform or a position to `trigger()`. Without a listener the origin is used.
Mini-game hosts without stereo panning report that limitation while retaining
software distance attenuation. See [Sound event source](#sound-event-source) for component
-and graph triggers. Dedicated event authoring and continuous preview remain in RM-066.
+and graph triggers.
+
+### Authoring sound events
+
+Choose **New → Create Sound Event** in the Content Browser, or select audio assets
+and use **Create Sound Event** in their context menu. Double-click a `.esaudioevent`
+to open its dedicated editor. Dropping audio into an empty event panel creates an
+event beside the first clip; dropping into an open event appends variants.
+
+Use the audio picker to add or replace clips. Drag rows or use the arrow buttons
+to reorder them; delete removes the slot, retaining its audio file. Weight `0`
+disables a slot. Selection mode, volume/rate ranges, bus, priority, concurrency,
+cooldown and optional spatial settings share the runtime's validated format.
+Edits participate in Undo/Redo, dirty-tab indicators, Save, autosave snapshots
+and external-file reload handling. Invalid files leave the current document intact.
+
+**Trigger** samples another variation; **Continuous** plays successive variations
+after completion while observing event cooldown and voice budgets. The preview
+uses the existing audio mixer and global pool, displays the last selected slot,
+clip, sampled volume and rate, and follows that voice with the shared waveform.
+Spatial preview places the source at the listener; test distance attenuation in
+the scene. The preview seed belongs to the editor, not the asset. Stopping or
+editing resets its stream; configure `SoundEventSource.seed` for runtime playback.
+
+Changing the definition, closing the panel, replacing the project or global Stop
+All cancels preview work. Waveform reuse keeps up to 64 peak arrays (about 200 KiB),
+without caching PCM in that cache. Disk changes and project replacement invalidate
+the peaks. Preview software checks do not replace device/output acceptance.
## `Audio` API reference
diff --git a/docs/astro/src/content/docs/zh-cn/assets/audio.mdx b/docs/astro/src/content/docs/zh-cn/assets/audio.mdx
index 77b635ff7..543fc2e4d 100644
--- a/docs/astro/src/content/docs/zh-cn/assets/audio.mdx
+++ b/docs/astro/src/content/docs/zh-cn/assets/audio.mdx
@@ -100,7 +100,28 @@ if (voice) {
空间事件复用 AudioSource 的衰减和声像计算,owner 需有世界变换,或在 `trigger()` 传入位置。
没有监听器时以原点为监听位置。小游戏宿主不支持立体声声像时会报告该限制,但仍应用软件距离衰减。
-组件与图动作见[音效事件源](#音效事件源)。专用事件制作界面和连续试听继续在 RM-066 中实施。
+组件与图动作见[音效事件源](#音效事件源)。
+
+### 制作音效事件
+
+在内容浏览器选择 **新建 → 创建音效事件**,或选中音频资源后从右键菜单创建。
+双击 `.esaudioevent` 打开专用编辑器。将音频拖到空事件面板,会在第一条音频旁创建
+事件;拖到已打开的事件则添加变体。
+
+用音频选择器添加或替换片段;拖动行或点击上下箭头排序。删除仅移除槽位,保留音频文件。
+权重 `0` 禁用槽位。选择模式、音量/速率范围、总线、优先级、并发上限、冷却和可选空间
+参数使用与运行时相同的校验格式。修改参与撤销/重做、脏标签、保存、自动保存快照和外部
+文件变更处理。无效文件不会替换当前文档。
+
+**触发试听**选择下一个变体;**连续试听**在片段完成后继续,并遵守事件冷却与声音预算。
+试听复用现有混音器和全局声音池,显示最后选中的槽位、片段及采样音量/速率,并用共享
+波形跟随该声部。空间试听把音源放在监听器位置;距离衰减请在场景中验证。
+试听种子是编辑器状态,不写入资源;停止或修改会重置试听流。运行时请配置
+`SoundEventSource.seed`。
+
+修改定义、关闭面板、切换项目或全局 Stop All 会取消试听。波形缓存最多保存 64 组峰值
+(约 200 KiB),其中不缓存 PCM。磁盘变化和项目切换使峰值失效。软件试听验证不能替代
+目标设备及实际输出验收。
## `Audio` API 参考
diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjs
index 96da16e63..11fd3119d 100644
--- a/tools/releaseNotes.mjs
+++ b/tools/releaseNotes.mjs
@@ -28,6 +28,12 @@ export const NOTES_FLOOR = 'v0.65.0';
* the reader recognises anyway.
*/
export const NOTED = {
+ 'perf(editor): reuse bounded audio waveform peaks':
+ { note: 'Sound events have a dedicated authoring panel.' },
+ 'feat(editor): author and preview sound event variants':
+ { note: 'Sound events have a dedicated authoring panel.' },
+ 'feat(editor): integrate sound event authoring':
+ { note: 'Sound events have a dedicated authoring panel.' },
'feat(audio): connect sound event sources and graph triggers':
{ note: 'Sound event sources share code and graph triggers.' },
'feat(editor): integrate sound event source references':