Skip to content

PreciseAudio queue stopping randomly after the end of a track. #70

@ErnestoArtigas

Description

@ErnestoArtigas

I'm trying to make an audio player and I'm using Precise Audio as the audio interface for a javascript code. It's using node and express to route the application, take files from a folder and pass to the updateTracks function :

const audio = new PreciseAudio();
// Array of all music files.
let sources = <%- JSON.stringify(audioSources) %>;
// Using the ... operator to split every element for the updateTracks function.
audio.updateTracks(...sources);

// A button was created in the html page so I'm just calling it with a querySelector
let button = document.querySelector("#play");
button.onclick = (event) => {
    audio.play();
}

The audio begins fine, but usually when i'm not active on the webpage it just stops and the end of the current tracks. Pushing the play button just continues the queue without any problems and printing the audio.trackStates() shows that it knows when to download the next track.

(19) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
0: {src: "/audio/08 - Welcome To The Machine.flac", state: "ready", mode: "full"}
1: {src: "/audio/09 - Déjà Vu.flac", state: "download-scheduled", downloadingAt: 1844590.746666666}
2: {src: "/audio/10 - The Last Refugee.flac", state: "none"}
3: {src: "/audio/11 - Picture That.flac", state: "none"}
...

Is it a limitation of the audio backend, not being able to load all the music files because they are too large for the specifications ?

Hope it was clear, as my first real project working with audio api I'm lost. Thank you by advance !

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