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

CCAudio.js sound effect resume is not working and always start from beginning if loop set to true #1836

Open
boqugames opened this issue Feb 23, 2017 · 1 comment

Comments

@boqugames
Copy link

    if (!this._loop) {
        if (audio.start)
            audio.start(0, offset, duration - offset);
        else if (audio["notoGrainOn"])
            audio["noteGrainOn"](0, offset, duration - offset);
        else
            audio["noteOn"](0, offset, duration - offset);
    } else {
        if (audio.start)
            audio.start(0);
        else if (audio["notoGrainOn"])
            audio["noteGrainOn"](0);
        else
            audio["noteOn"](0);
    }

should update to

    if (audio.start)
        audio.start(0, offset);
    else if (audio["notoGrainOn"])
        audio["noteGrainOn"](0, offset);
    else
        audio["noteOn"](0, offset);
@boqugames
Copy link
Author

boqugames commented Feb 23, 2017

BTW, in CCBoot.js
All audio effects is stop rather than pause when game pause (ex: switch tab), should we sync the behavior with audio music?

That is, pause all audio effects at game pause, and resume all effects at game resume and do not play some audio effect if the loop is false and playback is finished

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

1 participant