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

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

Open
ErnestoArtigas opened this issue Mar 27, 2021 · 0 comments
Open

Comments

@ErnestoArtigas
Copy link

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 !

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