Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Play any song from anywhere


  • Please log in to reply
32 replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
press ctrl+f12 then type any part of the name of song and press enter (or let it timeout by 5 secs) and the song plays! ..u can even add complete folders using this (add \ as prefix for folders)...works from all apps. doesn't even let other apps see that u're typing the song name!

if u press Insert instead of Enter, then songs will be added to playlist!

(change paths to point to your winamp installation and your songs folder)

SetBatchLines, 10ms

^F12::
        Input, UserInput, T5,{enter}{ins}
        ifequal,userinput,, return
        endkey=%errorlevel%
        Loop, e:\audio\mp3\*.*, 1, 1 
        { 
                mp3 = %A_LoopFileFullPath% 
                Found = Yes 
                Loop, Parse, UserInput, %a_space% 
                        IfNotInString, mp3, %A_LoopField%, SetEnv, Found, No 

                IfEqual, Found, Yes 
                { 
                        Ifnotinstring, mp3,.mp3, Ifinstring, mp3,., break

                        ifequal, endkey, Endkey:Insert, run, e:\program files\winamp\winamp.exe /ADD "%mp3%"
                        ifnotequal, endkey, Endkey:Insert, run, e:\program files\winamp\winamp.exe "%mp3%"
                        Found = No 
                        break 
                } 
        } 
Return 

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
That's pretty sweet, a stealth song player. People see you typing, and then a song plays.

For your next trick, please improve it to accept voice commands :)

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
u psychic Chris? :)

i've recently enabled voice commands by using a software with AHK, and was going to make a post regarding that sometime, so that anybody else interested may also use it.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Yes, that interests me. In an ideal world, I would like to be able to whisper a song name from 100 feet away, and due to sophisticated signal processing and a sensitive microphone, the computer would recognize the name and/or artist and play the song(s) I've requested.

Please deliver this solution by Monday ;)

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
and when i'm doing it, would u also like the added feature of your pc detecting what mood u're in right now and playing a suitable song by itself to make u feel better? :p

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


CarlosTheTackle
  • Members
  • 102 posts
  • Last active: Jan 29 2007 12:07 PM
  • Joined: 19 Oct 2004

and when i'm doing it, would u also like the added feature of your pc detecting what mood u're in right now and playing a suitable song by itself to make u feel better? :p


OK, so it's not fully automated, but this program does something along those lines. I've used if for a while now and highly recommend it. The developers are almost as interactive and helpful as Chris!

C

Heiko
  • Guests
  • Last active:
  • Joined: --
Hi Rajat, nice one, I really like the idea! However, the script does not find all of my mp3s. There are round about 8.000 mp3-files in my sub-folders and your script is finding nearly the half pretty fast.

As an example: I got some files of "rage against the machine". When I search for "rage" the script does not find any file. For "against" all files are detected correctly.
Another example: There are 3 Songs of "Andreas Johnson" in the same folder. Searching for "Andreas" or "Johnson" the script just found one song (the first one in alphabetical order).

Any idea? Thanks anyway for the script!

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
finding first song is default and intended behaviour. as for not finding songs, check for spelling errors please.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


  • Guests
  • Last active:
  • Joined: --
All right, now I've seen how it works:
whatever the script finds first, a mp3-file or a folder, will be opened with winamp. That's why there are sometimes more than one file opened by the script.
When I search for "Rage", the script finds "David Bowie - Suffragette City.mp3" first and ignors all files from "rage against the machine".
In my opinion, the 'perfect' skript would do the following:

- new playlist
- currentDir = startDir
- search(currentDir)
- END

- METHOD search(currentDir) 
  - if searchstring is in name of currentDir: add all files to playlist
  - if searchstring is in name of file(s) in currentDir: add file(s) to playlist
  - search(nextSubDir)

At the end, we've found all MP3s containing the searchstring and all MP3s in folders containing the searchstring.

This is just an idea. Unfortunately, I don't have the experience the implement that for AutoHotkey.

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004

All right, now I've seen how it works:
whatever the script finds first, a mp3-file or a folder, will be opened with winamp. That's why there are sometimes more than one file opened by the script.
When I search for "Rage", the script finds "David Bowie - Suffragette City.mp3" first and ignors all files from "rage against the machine".
In my opinion, the 'perfect' skript would do the following:

- new playlist
- currentDir = startDir
- search(currentDir)
- END

- METHOD search(currentDir) 
  - if searchstring is in name of currentDir: add all files to playlist
  - if searchstring is in name of file(s) in currentDir: add file(s) to playlist
  - search(nextSubDir)

At the end, we've found all MP3s containing the searchstring and all MP3s in folders containing the searchstring.

This is just an idea. Unfortunately, I don't have the experience the implement that for AutoHotkey.


You could create add a listbox displaying the results and an option to choose a song to play if you'd like to modify the script but that's not how the script was originally intended to work. Find all mp3 files containing "rage" on C drive...
Loop, c:\*rage*.mp3, 1, 1 
{
msgbox, %A_LoopFileFullPath%
}


Heiko
  • Guests
  • Last active:
  • Joined: --
Why adding a listbox? When I've got more than one song from "Blur" and search for "blur", why not putting all songs in the playlist?

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004

Why adding a listbox? When I've got more than one song from "Blur" and search for "blur", why not putting all songs in the playlist?

Ok. Then add them to the playlist one by one instead of to a listbox...

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
the idea behind this script is total simplicity + no UI. for more functions u can try my 320mph script / winamp's ML or some plugin.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

Why adding a listbox? When I've got more than one song from "Blur" and search for "blur", why not putting all songs in the playlist?

...though this sounds good!

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Heiko
  • Guests
  • Last active:
  • Joined: --
All right, I tried myself on the script. I changed the last lines to this:
ifnotequal, endkey, Endkey:Insert,
                        {
                                run, c:\winamp\winamp.exe "%mp3%" 
                                Endkey = Insert
                        }
                        Found = No 
                } 
        } 
Return

Now the script does not stop when getting the first match. However, there is one problem left. As far as I see the script add folders and files. So when there's a file Eels - I Like Birds.mp3 in the folder Eels and I search for eels the song will be added 2 times to the playlist.
Can anyone modify the script so that the script does not search in a folder or subfolder when the folder was already added to the playlist?