Giter VIP home page Giter VIP logo

Comments (6)

bigtimebuddy avatar bigtimebuddy commented on September 3, 2024 1

Thanks for the detailed bug. That makes sense. Will look at it soon

from sound.

ericente avatar ericente commented on September 3, 2024 1

I'm having some issues creating a fork right now, but this snippet seems to have fixed this issue in sound v4 in my project:

import { webaudio } from '@pixi/sound';
webaudio.WebAudioInstance.prototype.stop = function(){
    if (this._source)
    {
        this._internalStop();
    }
    this.emit('stop');
}

from sound.

ericente avatar ericente commented on September 3, 2024

I'm seeing this same issue, though my repro steps are slightly simpler

  1. call pauseAll()
  2. call stop() on a specific sound instance
  3. call resumeAll()

I believe what's happening is that when pause() is called on a sound, it's _internalStop() is getting called, which is nulling this._source, so when stop() gets called while the sound is already paused, it checks if this._source exists, it doesn't, and then nothing happens. I think if we were to emit the 'stop' event any time stop() gets called, regardless of whether _source exists, Sound should trigger _onComplete() and clean up any instances still in the _instances array.

I've only looked at the v4 code, but here's the instance stop:

if (this._source)
{
this._internalStop();
this.emit('stop');
}

and here's the _onComplete:

sound/src/Sound.ts

Lines 766 to 776 in a84c214

if (this._instances)
{
const index = this._instances.indexOf(instance);
if (index > -1)
{
this._instances.splice(index, 1);
}
this.isPlaying = this._instances.length > 0;
}
this._poolInstance(instance);

from sound.

nicolasalt avatar nicolasalt commented on September 3, 2024

I'm having the same issue, is there an ETA for the fix? Version 5.2.3.

Thank you!

from sound.

CatchABus avatar CatchABus commented on September 3, 2024

I did some digging and problem seems to be lying in refreshPause calls.
@nicolasalt Can you try changes from PR #270 a few times locally? It might be a candidate for fixing the issue.

from sound.

nicolasalt avatar nicolasalt commented on September 3, 2024

I've tried but your PR is on top of pixi/sound v6.0 which depends on pixijs v8, while I'm using pixijs v7.2.4.

from sound.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.