0

File Queuing/ Jukebox Emulation?

Hello everyone.

I'm trying to basically build a modern day jukebox whereas the user will punch in a three digit number to request an audio file (accomplishing this by using USB events and keyboard GPIO convertor). 

I've got BS playing files just fine, but my problem is I'd like to try to have it stack up requested triggers into a queue and fire them off after the subsequent one finishes. Like a jukebox. 

Initial state is a song of my choosing, and then will stop playback unless another one is selected. Again, once a new song is triggered via USB even, it will build up into a playlist of sorts with other future requests, and play one by one, etc.

Any clue how to accomplish this? Been racking my head all day and researching here like crazy-- but left empty. This would be easy if I could pre-define set playlists, but these are created live based off of user input via the USB event triggers, and the associated songs that are selected. 

Any help would be SUPER appreciated. Thanks!

Jason

4 comments

  • 0
    Avatar
    Pearl Snow

    Hello,

    That's an interesting project! To create a queue for your jukebox, you can use an array to store the song numbers as they are requested. When a USB event triggers, add the requested song's ID to the end of the array. Your playback logic can then be set up to check if the queue is not empty after the current song finishes. If there's a song in the queue, remove it from the front and start playing it. If the queue is empty, the jukebox can return to playing MyMilestoneCard your default song.

    Regards,
    Pearl

  • 1
    Avatar
    Bright Scripters

    Has this one been resolved?

  • 0
    Avatar
    Aliraza

    I'm trying to basically build a modern day jukebox whereas the user will punch in a three digit number to request an audio file (accomplishing this by using USB events and keyboard GPIO convertor). 

    I've got BS playing files just fine, but my problem is I'd like to try to have it stack up requested triggers into a queue and fire them off after the subsequent one finishes. Like a jukebox. Locksmith Keighley

    Initial state is a song of my choosing, and then will stop playback unless another one is selected. Again, once a new song is triggered via USB even, it will build up into a playlist of sorts with other future requests, and play one by one, etc.

  • 0
    Avatar
    Jason Garte

    @Bright Scripters sadly not yet. I’m not quite savvy enough to pull off what @Pearl Snow has suggested. I am going to try to use some ChatGpt mojo to figure it out. Would love some help developing this if anyone is up for the challenge?

Please sign in to leave a comment.