Skip to content

Incorrect behavior on resuming AudioSender #501

@Lyphion

Description

@Lyphion

Platform

Platform: Paper 1.21.10
PlasmoVoice Version: 2.1.6/2.1.8

Description

When resuming the AudioSender via the resume method the audio has an extrem delay, depending on the already elapsed playtime and pause time.

After looking at the source code, I think the issue is, that the startTime is reset to 0 (or the current System.nanoTime() after resuming) without respecting the value of sequenceNumber which is still at the same position/index. This causes the waitTime to became very high in the first iteration after the pause just to "match" the current index in the audio to the expected time.

A fix would be to recalculate the startTime after the resume or save the total pause time and combine it with the waitTime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions