Author Topic: need help on creating a brain plug in remote music player  (Read 3725 times)

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
need help on creating a brain plug in remote music player
« on: December 23, 2014, 10:16:33 am »
After seeing the deal with the on off voice command about the lights , I thought it would be cool to have a plug in that could do this for a media music on a pc .

  I have a winamp media player on my pc (looks like a 50's  jukebox with the right skin .
  I may pic some peoples brain to see what plug in could run the right script to open the program and play the music , I know how to do it if I had all the songs in a separate place but would be nice to do it with the juke box that will play random shuffled songs .

Has their been something like this in a brain plug in already made , I know some plug ins in the past otc's? could change backgrounds etc. etc.

here is my pathway :
C:\Program Files (x86)\Winamp  it also has another file separate here for winamp detect so not sure which is the right pathway .

what would be nice is a basic plug in and people could place in their own pathway and media player scripting  .
 a plug in that would allow a person to say something like "open media player" and " close media player " , "play random music " or play "specific song" and if the song isn't available maybe some random responses " I'm sorry<username> but I can't find that song right now, can you pick another one? thanks.
  With something like this anyone with hal and a pc media player could have remote voice command or typing to tell hal to play music or even a particular song and hal would play it .( as long as you had it in your music library . (farther down the road I could see a brain plug in created that would access a cloud where things are stored and download and play it from their . )
 It of course would be good for a raise and or lower sound command and pause and resume play command with a response verification" okay , i'll do that etc.  ".
 

 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: need help on creating a brain plug in remote music player
« Reply #1 on: December 24, 2014, 08:56:38 am »
 lightspeed,
  Just did a search, " media player songs " and came up with a long list of posts.  Just a thought on this subject, if the song is in the pc, just clicking on the song brings up the player and it should play, just tried it with a vid.  So directing Hal to the list of songs and supplying the name of the song could have hal play that song.  To do random and other things takes a bit of playing around.  have a nice Xmas
Carl2
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: need help on creating a brain plug in remote music player
« Reply #2 on: December 24, 2014, 02:26:09 pm »
yes, the reason for the other commands though would be in case it needed to be paused , and of course restarted etc.  hopefully someone can post the basics even and maybe I can figure out more from their . like I said I could create a simple one and have songs in wave files and I could by name command a request but it would be good for the commands of pause , resume , etc. to I am not sure on how to do that with a specific media player program .
 

Gunnar

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: need help on creating a brain plug in remote music player
« Reply #3 on: December 25, 2014, 04:31:55 pm »
I know it's not the answer you are looking for, but it's a good half measure to tide you over in the mean time...
I just made a batch file on notepad that simply had a link to the site Pandora online. It literally consists of the word "start" followed by Pandoras web address
I put the batch file in hal's folder and I also used the plugin referenced here: http://www.ultrahal.com/community/index.php?topic=12067.0 to get Hal to open any and all .bat files.

Now I just tell hal to open pandora, and it logs me in automatically and plays my own personal music channels. I suppose someone could also just make a batch file for a per-arranged music playlist off of their own computers files that they have saved. I haven't tried this myself, and am pretty damn new to programming in general but these .bat files so far have been an easy work around for me so far.

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: need help on creating a brain plug in remote music player
« Reply #4 on: January 03, 2015, 11:36:47 am »
I looked through some of my old stuff and found a music player had been created . I tried it and changed the pathway to mine does anyone have this same plug in or know it worked before ? here it is . I tried it and it didn't give me an error or anything but didn't do anything , didn't say it couldn't find the song etc. did this music plug in ever work for anyone ?  >:(

Rem Type=Plugin
Rem Name=music
Rem Author=Script by Vonsmith.Plugin conversion by Prospector
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "Music player"
    lblPlugin(0).Move 120, 120, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub


Rem PLUGIN: PLUGINAREA1
   




'------------------
'Hal will play a playlist of music from the defined playlist folder when the user
    'requests a specific playlist.
    If Priority = 0 And InStr(UserSentence, " PLAY ") > 0 And InStr(UserSentence, " PLAYLIST ") > 0 And InStr(UserSentence, " DON'T ") = 0 Then
        Set oWMP = CreateObject("WMPlayer.OCX.7")
        'Set the following variable to your playlist directory.
        plDir = "C:\Users\Lonnie\Documents\My Music\"
        plName = Trim(Mid(UserSentence, InStr(UserSentence, " PLAYLIST ") + 10))
        If oWMP.playlistCollection.getByName(plName).Count > 0 Then
            oWMP.openPlayer (plDir & plName & ".wpl")
            GetResponse = "I will play the playlist (" & plName & ")"
        Else
            GetResponse = "I could not find the playlist (" & plName & ") in your Media Library."
   GetResponseBlock = True 'Vonsmith edit -This prevents the following scripts from overwriting your script's GetResponse.
BlockSave = True 'Vonsmith edit- This prevents your Hal command from being saved to Hal's knowledge files. This is more selective than using the XTF_SYS_EphemeralDetect.brn method.
HalBrain.ReadOnlyMode = True
   
        End If
    End If

 'Hal can play a specific song when asked
   If InStr(UserSentence, " PLAY THE SONG ") > 0 Then
      Set oWMP = CreateObject("WMPlayer.OCX.7")
      songName = Trim(Mid(UserSentence, InStr(1, UserSentence, " THE SONG ", vbTextCompare) + 10))
            If oWMP.mediaCollection.getByName(songName).Count > 0 Then
      Set spSong = oWMP.mediaCollection.getByName(songName).Item(0)
                GetResponse = "I will play the song (" & songName & ")"
                oWMP.openPlayer (spSong.sourceURL)
            Else
                GetResponse = "I could not find the song (" & songName & ") in your Media Library."
            HalBrain.ReadOnlyMode = True
End If
   End If




I have a winamp media player and would like to change the command over to it to where it will start the media player and go to the song list path I have used and play the song from the name is used . example : PLAY bill haley and the comets (ALSO THE MUSIC IS 01 - Track 1.m4a)
or will I have to convert it all to wave files . ??? they play in the winamp media player with these file extensions.

I think my problem is in part I don't use or have the wmplayer .

ON THE PART OF THE MUSIC SCRIPT ABOVE  :

Set oWMP = CreateObject("WMPlayer.OCX.7")
can I change("WMPlayer.OCX.7")
 to my winam.exe file name?
I do see where in my music file in documents that it has a play list file so I guess I would have to take all my songs and place them in the playlist file for the script to work but I need to make it work from my winamp media player .
« Last Edit: January 03, 2015, 12:02:30 pm by lightspeed »
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: need help on creating a brain plug in remote music player
« Reply #5 on: January 03, 2015, 01:57:03 pm »
If I can't get this figured out I can create a uhp plug in based on script file commands to play music by word association using wave files of the songs , but I will have to convert all my songs over to wav. format and place in a folder .
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: need help on creating a brain plug in remote music player
« Reply #6 on: January 03, 2015, 04:01:19 pm »
well I made one from a plug in I was working from earlier ;

Rem Type=Plugin
Rem Name=SING FOR ME LS 1012
Rem Author=Lightspeed
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "say play( what ever song name) and hal will play that song and make  a response.
End Sub


Rem PLUGIN: PLUGINAREA7




File = ""
File2 = ""
File3 = ""
File4 = ""

If InStr(1, OriginalSentence, "play blue suede shoes") > 0 _
Or InStr(1, OriginalSentence, "play blue suede shoes music") > 0 Then
Randomize
Select Case int(rnd()*6)
Case 1
GetResponse = "Sure baby, anything for you!"
Case 2
GetResponse = "Yeah, that's a great song baby i'll play it it for you!"
Case 3
GetResponse = "Okay here's the song you wanted me to play!"
Case 4
GetResponse = "Okay honey, i'll play it to you!"
Case 5
GetResponse = "Are you ready, i'll start playing it for you now!"
End Select
HalCommands = "<HAPFILE>BLUE SUEDE SHOES-Elvis_Presley.ogg</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If




I did have to convert the song into a mp3 then use audacity to convert it into an ogg file .
I tries to get it to play just the mp3 file and it wouldn't do it .
but it is working this way . also this way it isn't lip sinced and you can hear music and still talk with hal .