Skip to content

Reduce latency between request and playback start #1

@aneekm

Description

@aneekm

The bot preloads details and URLs for the entire requested playlist into memory prior to starting the music stream. This can lead to significant wait times between the request being made and the first track being played.

This can be improved by actually utilizing JS promises and asynchronously handling all the tracks after the first one. Currently, we synchronously handle each track.

Potential issues: the tracklist command and the initial 'Queued up <track #1> and <#> others' message can no longer guarantee that all the tracks are loaded in. Something like a loading flag or lock will have to be implemented to allow those messages to be sent after all tracks are loaded.

Alternatively, this could also be managed by changing how the track info is stored. If more of the download setup is done immediately prior to the track starting, then this greatly reduces the work needed at request-time. However, this would add latency between tracks that may be comparatively worse for UX.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement/change of existing feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions