Jump to content
LaunchBox Community Forums

LaunchBox Ambient Music Player 1.2.1

   (2 reviews)

1 Screenshot

About This File

Listen to your favorite Arcade music playlist while admiring your LaunchBox collection.
Requires LaunchBox 13.3 or newer

Just add your own playlists and start listening when LaunchBox starts.  The music will pause when launching a game, and then resumes after exiting the game.


Setup:
Download and extract the contents of the zipped file into /LaunchBox/Plugins/

Quick Start:
With LaunchBox closed
    Copy a music playlist (i.e. MyPlaylist.m3u) into the Playlists subfolder
        i.e. /LaunchBox/Plugins/LBambient/Playlists/MyPlaylist.m3u
    Start LaunchBox

See Playlists below for playlist requirements.

About this plugin:
Place your music playlist(s) into /LBambient/Playlists/
    When you start LaunchBox, a random (if there're more than 1) playlist from that folder will be selected and start playing

Songs in the playlists will be played in a random order and will not repeat.

Songs will Pause when launching a game and then Resume when the game has exited.
    Fixed v1.2.0 Exception: It might not stay paused when launching Steam games and others using a launcher.

Once the player has gone through the entire playlist, that's it. No more music.
    So, if you plan to spend a lot of time looking at LaunchBox and not playing games, be sure to have a long playlist.


Options:
Go to Tools - LB Ambient Music

Adjust the player's volume slider (which is independent of LaunchBox's volume control) to your desired volume.
    Click Save Volume to save it in Settings for next time you start LaunchBox.

To manually select a specific playlist (or song) to load when LaunchBox starts
    Click Load to select a playlist (or song) and start playing it.
    The selection will be saved in Settings.
    Next time you start LaunchBox (and every time thereafter), the saved selection will be played.

To remove a playlist (or song) from Settings, click Clear Selection.
    This immediately stops the player and removes it from Settings.
    Next time you start LaunchBox, a random playlist (if any exists) will be selected from /LBambient/Playlists/ and automatically start playing.

Click Hide to close window.


Playlists:
Required: Playlists MUST have absolute paths to the song(s).
    Some players (i.e. VLC) will save the playlists using relative paths if it's saved within the players folder structure.

(new v1.1.0) Playlists can have absolute or relative paths to the songs.  Relative paths MUST be relative to the Playlists subfolder

Playlist formats tested are  .m3u, .m3u8 and .xspf
No other formats have been tested and will not work with this plugin.
If you have playlists saved in a different format that you'd prefer to use, let me know.

THIS HAS ONLY BEEN TESTED WITH LOCAL FILES.
If the files paths in the playlists are URL's (i.e. start with "http://"), things might break.  
    You can try it if you want. Let me know what you find.


As always, all comments and suggestions are graciously accepted and encouraged. 😎


What's New in Version 1.2.1   See changelog

Released

New Feature:   Added option to continue playing Ambient Music when LaunchBox has lost focus
                                                       Multitask while still keeping the vibe. ;) 

With this option enabled, Steam games will pause the music during gameplay.  But other games using a similar launch window will not.

  • Like 3
  • Thanks 1

User Feedback

Recommended Comments

@tycho

Quote

I have some suggestions for future features:

Ability to specify a specific playlist per platform
Ability to toggle which platforms use the plugin
Fade out audio when starting a game (versus current hard cut)

Thanks for the suggestions.  I will add those to the request list.  Though not out of reach, don't hold your breath too long. ;) 

 

Quote

Bugs/issues:

I noticed that despite the description stating that the music/audio ends after the last file in the playlist has been played, my audio stopped after a single track; in other words, upon startup, the plugin selects one audio file from the playlist at random, plays that file, then stops

Can you attach your log file (located in the /LBambient/Logs folder)?  Hopefully that can shed some light as to what's going on.  (just drag and drop the .txt file onto your reply)

 

Quote

Audio continues playing when switching to another application, instead of pausing when LB loses focus (not sure if this is intended behavior)

I had that on my to-do list as a question. It's not implemented, so I guess you can say it is intended behavior. :D

I was kind of waiting for a general consensus if people preferred it that way before spending time implementing it.

Link to comment
Share on other sites

tycho

Posted (edited)

23 minutes ago, JoeViking245 said:

 

Thanks - here's one of the logs. I started LB, selected a game but did not start it, then closed LB after the track ended, and no other track started playing. Also, my MP3s are in the same folders as my M3U playlist, and the files in the playlist are entered as FILENAME.MP3.

log 2024-07-03 19-08-42.txt

Edited by tycho
Link to comment
Share on other sites

35 minutes ago, tycho said:

Thanks - here's one of the logs. I started LB, selected a game but did not start it, then closed LB after the track ended, and no other track started playing. Also, my MP3s are in the same folders as my M3U playlist, and the files in the playlist are entered as FILENAME.MP3.

Hmm..  The directions only said to put playlists into the /Playlists/ folder.  But at the same time, it didn't say to not put music files in there.  Guess I never tested it with having the mp3 files in the same folder as the playlist.  

It appears the plugin will grab any 'random' file in the /Playlists/ folder and try to play it.  In your case, it's grabbing an mp3 file instead of a playlist.  Of course, when the mp3 file is done playing, it's done.  Hence no next track.

In the meantime, maybe store the music files elsewhere and create the m3u using absolute paths.  That, or Load the playlist from the menu.

But I'll add the 'search ONLY for playlists' to my to-do list. 😊

 

Link to comment
Share on other sites

tycho

Posted (edited)

3 hours ago, JoeViking245 said:

In the meantime, maybe store the music files elsewhere and create the m3u using absolute paths.  That, or Load the playlist from the menu.

I made a folder for the audio files in the main LBambient folder (\LBambient\MP3), and restructured the M3U to reflect that. Instead of absolute paths, I used ..\MP3\filename.mp3. This structure works when I play the M3U using something like ZoomPlayer - the actual tracks are found and all the files in the playlist are visible. However, the same M3U does not trigger anything in LaunchBox. Logs show "playlist contains 0 entries." After that failed, I made the paths absolute (\Launchbox\Plugins\LBambient\MP3\filename.mp3) - still no joy.

log 2024-07-03 23-22-22.txt

Edited by tycho
Link to comment
Share on other sites

24 minutes ago, tycho said:

I made a folder for the audio files in the main LBambient folder (\LBambient\MP3), and restructured the M3U to reflect that. Instead of absolute paths, I used ..\MP3\filename.mp3. This structure works when I play the M3U using something like ZoomPlayer - the actual tracks are found and all the files in the playlist are visible. However, the same M3U does not trigger anything in LaunchBox. Logs show "playlist contains 0 entries." After that failed, I made the paths absolute (\Launchbox\Plugins\LBambient\MP3\filename.mp3) - still no joy.

The plugin uses absolute paths because who knows where the playlist was created from. a.k.a. Relative to what. It's just easier that way.  The path you show here is not an absolute path.  It's missing the drive letter.

i.e.   G:\Launchbox\Plugins\LBambient\MP3\filename.mp3

I personally don't use playlists so in my testing I had VLC create some for me and that's what I based it off.  I presumed it created the playlist using some "universal language". ;)

If you could share the m3u you had created from ZoomPlayer, that would be helpful to see why it didn't pick up your paths (unless they were in there like you show above).

Link to comment
Share on other sites

Sorry for the silly question but how is this diffrent to already inbuilt option for background music?

Link to comment
Share on other sites

3 hours ago, asmeghead said:

Sorry for the silly question but how is this diffrent to already inbuilt option for background music?

LaunchBox doesn't have built-in background music whereas BigBox does. This is just for LaunchBox. 

"Background" [ambient].  Not to be confused with per-game music which both LaunchBox and BigBox do have.

  • Like 1
Link to comment
Share on other sites

11 hours ago, JoeViking245 said:

The plugin uses absolute paths because who knows where the playlist was created from. a.k.a. Relative to what. It's just easier that way.  The path you show here is not an absolute path.  It's missing the drive letter.

i.e.   G:\Launchbox\Plugins\LBambient\MP3\filename.mp3

I personally don't use playlists so in my testing I had VLC create some for me and that's what I based it off.  I presumed it created the playlist using some "universal language". ;)

If you could share the m3u you had created from ZoomPlayer, that would be helpful to see why it didn't pick up your paths (unless they were in there like you show above).

First, this is my folder structure:

LBambient
  ├─ Logs
  ├─ MP3
  └─ Playlists

Syntax I have tried in the M3U to no avail:

  • G:\Launchbox\Plugins\LBambient\MP3\filename.mp3  [Absolute]
  • \Launchbox\Plugins\LBambient\MP3\filename.mp3  [Relative Long]
  • ..\MP3\filename.mp3  [Relative Short]

In my testing, the Absolute and Relative Short structure playlists work in ZoomPlayer/VLC, but Relative Long does not. None of the three work with LBambient. I've attached all three M3Us here...

 

MyPlaylist (absolute).m3u MyPlaylist (relative long).m3u MyPlaylist (relative short).m3u

Link to comment
Share on other sites

1 hour ago, tycho said:

Syntax I have tried in the M3U to no avail:

  • G:\Launchbox\Plugins\LBambient\MP3\filename.mp3  [Absolute]

So there was either some tomfoolery done when generating the (absolute) playlist, or you manually created it.  I suspect the latter.  

If you had VLC generate the playlist, how did you get it to remove all the m3u Tags?  Also, other thing VLC did on my playlists when generating them was to add file:/// to the beginning of each path. So that's what I had the plugin look for.

I'll have the next release to also be able to scan manually created playlists [that only list the absolute paths (and without file:///)]. (or let me know how you generated it that way and I can work from that angle too).

In the meantime, try this one.

MyPlaylist (absolute).m3u

Link to comment
Share on other sites

9 hours ago, JoeViking245 said:

So there was either some tomfoolery done when generating the (absolute) playlist, or you manually created it.  I suspect the latter.  

If you had VLC generate the playlist, how did you get it to remove all the m3u Tags?  Also, other thing VLC did on my playlists when generating them was to add file:/// to the beginning of each path. So that's what I had the plugin look for.

I'll have the next release to also be able to scan manually created playlists [that only list the absolute paths (and without file:///)]. (or let me know how you generated it that way and I can work from that angle too).

In the meantime, try this one.

MyPlaylist (absolute).m3u 2.22 kB · 1 download

Further testing yields that only absolute pathing works for this plugin, despite relative pathing working in VLC/ZoomPlayer. My personal preference is relative pathing, since I sometimes share my LB build with friends; absolute pathing makes that difficult.

Link to comment
Share on other sites

7 hours ago, tycho said:

Further testing yields that only absolute pathing works for this plugin

Correct.

image.png.379b1736f76f778dc731613a610754bc.png

 

7 hours ago, tycho said:

My personal preference is relative pathing

Thanks for your feedback. I will take that into consideration.

  • Thanks 1
Link to comment
Share on other sites

Version 1.1.0-beta-1

Fixed:                  Now Playing not showing the entire song title for long names
Fixed:                  When scanning /Playlists/ folder for playlists, it now looks ONLY for [actual] playlists (.m3u, .m3u8, .xspf)
Improvement:  Fade out/in audio when starting/exiting a game
Improvement:  Playlists can now contain relative paths.  Paths must be relative to /Playlists/

⟶ LBambient (v1.1.0-beta-1).7z

@tycho You might have some interest in this. ;) 

  • Thanks 1
Link to comment
Share on other sites

7 hours ago, JoeViking245 said:

 

@tycho You might have some interest in this. ;) 

WOW. You're spot on - relative pathing works great, and I love the fades. Thanks!

  • Thanks 1
Link to comment
Share on other sites

Plugin updated to version 1.2.0

Player now pauses when LaunchBox loses focus.  This also fixes the issue with music not staying paused when running games that use a launcher (i.e. Steam).

 

previous update v1.1.0

Fixed:                  Now Playing not showing the entire song title for long names
Fixed:                  Tools Menu icon causes BigBox to crash
Fixed:                  When scanning /Playlists/ folder for playlists, it now looks ONLY for [actual] playlists (.m3u, .m3u8, .xspf)
Improvement:  Fade audio out/in when starting/exiting a game
Improvement:  Playlists can now contain relative paths.  Paths must be relative to /LBambient/Playlists/

Link to comment
Share on other sites

Posting this in the correct section this time!

Hi Joe,

JoeViking - As requested in our discord chat, please could you add a button/switch in the UI controls a toggle to keep music playing when LB is not in focus? (and even more cleverly pauses when a game is launched ) :D.

Hope this can be implemented in the future.

Cheers

  • Like 1
Link to comment
Share on other sites

1 minute ago, Volikhar said:

JoeViking - As requested in our discord chat, please could you add a button/switch in the UI controls a toggle to keep music playing when LB is not in focus? (and even more cleverly pauses when a game is launched ) :D.

Hope this can be implemented in the future.

Thank for the suggestion.  I'll have my team look into this.  Adding an option to reverse what was implemented in v1.2.0 wouldn't be an issue. 

The issue is, the issue that v1.2.0 fixed.  Games which are started via a launch window such a Steam will have the Ambient Music still playing during gameplay.  You'll see this related issue with a games Shutdown Screen.  Have you ever seen the LaunchBox Shutdown Screen after exiting a Steam game?  Didn't think so. ;)

I have a fix here that will resolve "the issue" for at least Steam games (for both Shutdown Screens and Ambient Music still playing during gameplay [if I decide to implement the option to keep musing playing.]).  I might-be-able-to incorporate a similar method into the plugin which will pause the music during a game launched via Steam.  No promises on either implementation.

Link to comment
Share on other sites

Version 1.2.1 Released

New Feature:   Added option to continue playing Ambient Music when LaunchBox has lost focus
                                                       Multitask while still keeping the vibe. 😎 

With this option enabled, Steam games will pause the music during gameplay.  But other games using a similar launch window will not.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...