Skip to content

Composition audio beds are dropped in head-only composition modes #147

Description

@Brad-Edwards

Review finding

Composition navigation modes that truncate a composition to its head scene rebuild the composition context without carrying audioBed forward. mode=standalone intentionally suppresses beds, but mode=loop and mode=scrub are audible modes and should preserve the surrounding composition bed.

Evidence

  • src/runtime/scene-loader.ts:1561 applySingleSceneSlice() creates a new composition object with id, manifestSlice, sceneSlice, and startIndex, but omits audioBed.
  • src/runtime/scene-navigation.ts:492 truncateToHead() has the same omission for direct bridge callers.
  • src/runtime/scene-loader.ts:1315 passes a bed to createAudioService() only from resolved.composition?.audioBed, so once the slice transform drops it the bed cannot play.

Impact

A bed-carrying composition addressed with mode=loop or mode=scrub silently loses its bed. This makes composition playback differ from the declared composition and from present-mode behavior. Direct callers of loadSceneNavigationTarget() also get a truncated head slice without the bed.

Recommended fix

Preserve audioBed when head-only composition slices are rebuilt, and keep the existing bedSuppressed: mode === 'standalone' behavior as the explicit standalone suppression point.

Acceptance checks

  • applySingleSceneSlice() preserves resolved.composition.audioBed when rebuilding the head slice.
  • truncateToHead() preserves target.composition.audioBed for direct callers.
  • Tests cover a composition with an audioBed in mode=loop and mode=scrub and prove the bed is constructed/started.
  • Existing standalone tests continue to prove mode=standalone suppresses the bed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:audioAudio service, mute, autoplay unlock, sprite playbackarea:compositionComposition manifests, resolution, recompositionarea:navigationURL grammar, workbench mode dispatch, browser routingbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions