aframevr / aframevr/aframe

Audio asset throws `TypeError` when `preload="auto"` is used.

Open
#3,774 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

Description:

Hey, guys. I know you guys are hard at work on 0.9.0, but this issue has been plaguing some of us for some time and were hoping a fix could be managed in the next release.

Setting an <audio> asset within <a-assets> with preload="auto" (as documented at https://aframe.io/docs/master/components/sound.html#preloading-a-sound-asset) throws the following error:

Firefox 62.0.2 (Windows):

TypeError: Argument 1 of BaseAudioContext.decodeAudioData does not implement interface ArrayBuffer.[Learn More] three.js:37939:18 

Chrome 69.0.3497.100 (Windows):

three.js:37941 Uncaught (in promise) TypeError: Failed to execute 'decodeAudioData' on 'BaseAudioContext': parameter 1 is not of type 'ArrayBuffer'.
    at three.js:37941
    at three.js:30404
  • A-Frame Version: 0.8.2
  • Platform / Device: Reproduced in Firefox and Chrome on Windows 10 (only ones tested)
  • Reproducible Code Snippet or URL:

Code:
https://glitch.com/edit/#!/aframe-audio-preload-bug

Demo:
https://aframe-audio-preload-bug.glitch.me/

I'm not sure if this is more of a THREE issue, but this is not working as documented. This makes it difficult to preload audio without maybe resorting to the use of autoplay on the audio source, which isn't ideal.

Looking forward to 0.9.0! Keep up the great work.

Thanks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Glitch reproduction and demo, then read the sound component's preloading behavior described in the A-Frame sound documentation. Trace the three.js decodeAudioData call shown in the Firefox and Chrome errors to identify why preload="auto" supplies the wrong value. Done means the reproduction preloads the audio asset without a TypeError in both reported browsers.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, three.js
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.