diff --git a/apps/editor/public/audios/sfx/paint_apply.mp3 b/apps/editor/public/audios/sfx/paint_apply.mp3 new file mode 100644 index 00000000..6fabae1f Binary files /dev/null and b/apps/editor/public/audios/sfx/paint_apply.mp3 differ diff --git a/packages/editor/src/components/editor/selection-manager.tsx b/packages/editor/src/components/editor/selection-manager.tsx index d1a42ee6..b0416476 100644 --- a/packages/editor/src/components/editor/selection-manager.tsx +++ b/packages/editor/src/components/editor/selection-manager.tsx @@ -1157,6 +1157,7 @@ export const SelectionManager = () => { } interaction.apply() + sfxEmitter.emit('sfx:paint-apply') if (activePreview?.key === interaction.key) { activePreview = null } else { diff --git a/packages/editor/src/lib/sfx-bus.ts b/packages/editor/src/lib/sfx-bus.ts index ff555612..262525d5 100644 --- a/packages/editor/src/lib/sfx-bus.ts +++ b/packages/editor/src/lib/sfx-bus.ts @@ -16,6 +16,7 @@ type SFXEvents = { 'sfx:snapshot-capture': undefined 'sfx:menu-hover': undefined 'sfx:menu-click': undefined + 'sfx:paint-apply': undefined } /** @@ -45,6 +46,7 @@ export function initSFXBus() { sfxEmitter.on('sfx:snapshot-capture', () => playSFX('snapshotCapture')) sfxEmitter.on('sfx:menu-hover', () => playSFX('menuHover')) sfxEmitter.on('sfx:menu-click', () => playSFX('menuClick')) + sfxEmitter.on('sfx:paint-apply', () => playSFX('paintApply')) } /** diff --git a/packages/editor/src/lib/sfx-player.ts b/packages/editor/src/lib/sfx-player.ts index 5106c7c7..f4d12e65 100644 --- a/packages/editor/src/lib/sfx-player.ts +++ b/packages/editor/src/lib/sfx-player.ts @@ -100,6 +100,15 @@ export const SFX: Record = { volumeRange: [0.5, 0.6], panJitter: 0.1, }, + // Fired when a material is applied to a surface in paint mode. Painting can + // fire in quick succession across faces, so keep variation + a small gap. + paintApply: { + src: '/audios/sfx/paint_apply.mp3', + rateRange: [0.95, 1.05], + volumeRange: [0.85, 1.0], + panJitter: 0.12, + minIntervalMs: 60, + }, } as const export type SFXName = keyof typeof SFX