diff --git a/protocols/schemas/scene.prs b/protocols/schemas/scene.prs index 5375651..320fe1a 100644 --- a/protocols/schemas/scene.prs +++ b/protocols/schemas/scene.prs @@ -8,12 +8,7 @@ PortalDestination = Gravity = . -AmbientSound = . - -SoundSpec = -/ @stream -/ @loop -. +AmbientSound = . ; Message Touch = . diff --git a/protocols/schemas/shapes.prs b/protocols/schemas/shapes.prs index a03f444..6de3322 100644 --- a/protocols/schemas/shapes.prs +++ b/protocols/schemas/shapes.prs @@ -34,7 +34,11 @@ Color = / @transparent . -Sound = . +Sound = . +SoundSpec = +/ @stream +/ @loop +. Name = . diff --git a/src/index.ts b/src/index.ts index 95a1140..71466ba 100644 --- a/src/index.ts +++ b/src/index.ts @@ -34,7 +34,7 @@ function interpretScene(myId: string, runningEngine: RunningEngine, rootMesh: Me during SceneProtocol.AmbientSound({ "name": $name: string, - "spec": $spec: SceneProtocol.SoundSpec + "spec": $spec: Shapes.SoundSpec }) => spawn named `sound:${name}` { const sound = buildSound(name, runningEngine.scene, spec, false); on stop sound.dispose(); diff --git a/src/shapes.ts b/src/shapes.ts index d362229..2bc42fe 100644 --- a/src/shapes.ts +++ b/src/shapes.ts @@ -191,7 +191,7 @@ export function buildMesh( } } -export function buildSound(name: string, scene: Scene, spec: SceneProtocol.SoundSpec, spatial: boolean): Sound { +export function buildSound(name: string, scene: Scene, spec: Shapes.SoundSpec, spatial: boolean): Sound { const options: ISoundOptions = { loop: true, autoplay: true,