aframe: Regression: Sound component not playing audio asset across multiple entities in 0.8.*

Description:

When multiple entities utilize the sound component, and use the same audio asset source, only one instance of audio is created in 0.8.*.

This does work as expected in 0.7.* as long as an <audio> element is used rather than an <a-asset-item>.

In 0.8.*, only the first entity of its kind in the code emits audio and TypeError: Argument of AudioContext.decodeAudioData can't be a detached buffer - three.js:37939:18 is thrown.

As I expected, poolSize has no effect, I’m assuming due to the fact that this is across multiple instances of the sound component and not contained within one component.

  • A-Frame Version: 0.8.0 and 0.8.1
  • Platform / Device: Chrome, Firefox, Edge on Windows 10 (all I’ve tested thus far)
  • Reproducible Code Snippet or URL: https://codepen.io/dansinni/pen/yKOjem

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 22 (16 by maintainers)

Most upvoted comments

@dsinni - fork A-Frame & edit the dist code directly to reflect the changes made in this PR

if you’re importing it as a node module, be sure to update dist/aframe-master.js.

if you want 0.8.2, i’d branch from commit #46b1362 to play it safe, as the commit log around the release looks a little messy.

for what it’s worth, we’re using commit #d5bb456 (A-Frame 0.8.2 + Three.js R92) in production without any issues, but we’re only targeting the Oculus Browser with the GearVR so I can’t verify other platforms.

additionally, it seems like my PR will be part of Three.js R93, but I don’t know when that will be wrapped up into A-Frame.

@dsinni - the PR can be found here. Not certain it’ll be accepted, as it might be more of a workaround rather than a fix.

We fork A-Frame to hack in some fixes specific to our project’s implementation, and have temporarily modified the build/aframe-master.js with those changes just to get up and running. Given that A-Frame uses a fork of three, this seemed like the best (temporary) approach for us as we don’t want to fork of that too.

@ngokevin - is there any information/advice/direction you can offer here?