Author Topic: playing music in elite  (Read 8430 times)

Barney Bear

  • Newbie
  • *
  • Posts: 3
playing music in elite
« on: February 19, 2017, 06:50:57 AM »
Hi Guys

I am a massive Elite dangerous player and voice attack in my opinion is essential (especially in VR). I have a command set for playing my favourite music when I am wandering around in space but my problem is that it will only play one song at a time then I have to repeat my command.

Is there a way of getting VA to play music as in a play list like media player or MS groove?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4778
  • RTFM
Re: playing music in elite
« Reply #1 on: February 19, 2017, 07:28:37 AM »
You could use the "Wait until sound completes before continuing command" feature for the "Play a Sound" action, so that once one song is finished playing you automatically trigger the next.

Play my song [and stop;]
Code: [Select]
Set Boolean [PlayMusic] to False
Play sound, 'MySong.mp3'  (and wait until it completes)
Begin Text Compare : [{CMD}] Does Not End With 'stop'
    Begin Boolean Compare : [PlayMusic] Equals False
        Execute command, 'Play Music'
    End Condition
End Condition
This command can be duplicated for each song you want to be able to trigger by name

Note that the "This completes all other currently-player sounds" option for the "Play a Sound" action should be enabled, so that if the random music is playing, it stops mid-song, rather than when the loop would come around.

The reason it checks whether "PlayMusic" is false before triggering the command is to prevent the scenario where you trigger another song by name, which would stop the song in another command, leading that command to trigger random play.

Play Music
Code: [Select]
Set Boolean [PlayMusic] to False
Play sound, 'blank.mp3'  (and wait until it completes)
Set Boolean [PlayMusic] to True
Start Loop While : [PlayMusic] Equals True
Play random sound (32 items - suppress repeats)
End Loop
This command is common to all individual song commands, and will play songs in a random order.

The top two actions are optional, but the idea is that you play a blank sound file with the "This completes all other currently-player sounds" option enabled to stop any previous instances of the "Play Music" command if it has been triggered directly. If that doesn't work, you may need to add a slight delay after those two actions to give the other command a chance to pick up on the change(though with the speed loops cycle, this hopefully won't be necessary).
This may come in useful if it randomly plays the same song twice, or you simply wish to skip a song and try for another.


Though, if you really want media player functionality, you're probably best off using an actual media player.

id3oM0T0R

  • Guest
Re: playing music in elite
« Reply #2 on: March 11, 2017, 07:28:52 AM »
Hey. Sorry, I totally missed your post. I found a relatively simple yet quite powerful solution.

http://voiceattack.com/smf/index.php?topic=979.0

mikelimtw

  • Jr. Member
  • **
  • Posts: 51
Re: playing music in elite
« Reply #3 on: March 15, 2017, 12:24:39 AM »
I am using iTunes as my audio player. Usually, I will load up a play list before I start Elite. What I did is to make a list of commands that selects iTunes as the application focus. iTunes has specific keyboard shortcuts to allow basic control. At the end of each command, I make a call to a small routine that places the mouse cursor on the upper right corner of Elite (I'm playing in fullscreen windowed mode) and does a left click to restore focus to the game.

Gangrel

  • Caffeine Fulled Mod
  • Global Moderator
  • Full Member
  • *****
  • Posts: 216
  • BORK FNORK BORD
Re: playing music in elite
« Reply #4 on: March 15, 2017, 04:26:53 AM »
I just setup foobar2000 with a nice plugin ( foo_cmd_playlist ) so that I can swap to predefined playlists with a voice command. Very handy and it means that the music player doesn't take focus when you load the playlist up.

I also set foobar up with a few global media control keys (the normal play/pause, next, previous, stop), as well as an app specific volume control (as well as the normal system wide) and output switch (so I can have the music go through headset/laptop if I wanted).