Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spatial Audio + Loop crash in 2.0.13 #985

Closed
timothyallan opened this issue Jul 3, 2018 · 3 comments
Closed

Spatial Audio + Loop crash in 2.0.13 #985

timothyallan opened this issue Jul 3, 2018 · 3 comments

Comments

@timothyallan
Copy link

Works great in previous versions, but I now get Failed to set the 'loopEnd' property on 'AudioBufferSourceNode': The provided double value is non-finite. when trying to play a looped spatial audio file now with 2.0.13.

Setting loop to false plays the sound just fine.
Not setting any pannerAttr's also plays the sound fine.

      // Setup looping and playback rate.
      sound._node.bufferSource.loop = sound._loop;
      if (sound._loop) {
        sound._node.bufferSource.loopStart = sound._start || 0;
        sound._node.bufferSource.loopEnd = sound._stop;
      }

It craps out in the section above as sound._stop is undefined;

As a secondary issue: if I set loopEnd to 0 in that above code, I start getting other pannerAttr property errors unless I supply every single pannerAttr attribute, whereas before it would use the defaults if I only supplied a couple.

@goldfire
Copy link
Owner

Do you have a test case of what triggers this? We have quite a few looping spatial sounds in our games that are running 2.0.13 and we haven't seen this come up so far.

@timothyallan
Copy link
Author

timothyallan commented Jul 12, 2018

As far as I know, I'm simply making a new sound, setting the spatial properties, and it's conking out.


        this.audioPlayer = new Howl({
          src: file.link,
          autoplay: false,
          loop: false,
          volume: 0.5,
          onplay: () => {
            console.log('onplay!');
            this.isAudioPlaying = true;
          },
          onend: this.handleAudioStop,
          onstop: this.handleAudioStop,
          onload: this.handleAudioLoaded,
          onloaderror: this.handleAudioError,
        });

this.audioPlayer.pannerAttr({
              coneInnerAngle: 360,
              coneOuterAngle: 360,
              coneOuterGain: 0,
              maxDistance: 10000,
              panningModel,
              refDistance: 0.8,
              rolloffFactor: 2.5,
              distanceModel: 'exponential',
            });

if I comment out the this.audioPlayer.pannerAttr part, it works.

@goldfire
Copy link
Owner

Thanks, I'm able to reproduce the issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants