Skip to content

Audio template #40

Description

@nicolocarpignoli

Audio template should be changed following this one, as they actually do not work:


// blabla imports...

<script>
    AFRAME.registerComponent('registerevents', {
	init: function () {
		var marker = this.el;

		var sound = document.querySelector('#sound-entity');

		marker.addEventListener('markerFound', function() {
			sound.components.sound.playSound();
        })
	}
});
</script>

<body style='margin : 0px; overflow: hidden;'>
    <a-scene
        vr-mode-ui='enabled: false;'
        renderer="logarithmicDepthBuffer: true;"
        embedded arjs='trackingMethod: best; sourceType: webcam; debugUIEnabled: false;'>

        <a-assets>
            <a-asset-item id="sound" src="<sound-file-url>" response-type="arraybuffer"></a-asset-item>
        </a-assets>

        <a-marker
            // blabla same as pattern marker for other content
            registerevents
            emitsevent="true">

        </a-marker>
        <a-entity id="sound-entity" sound="src: #sound" autoplay="false"></a-entity>
	<a-entity camera></a-entity>
    </a-scene>
</body>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions