Skip to content

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

@boqugames

Description

@boqugames
    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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions