1

I'm attempting to use VoiceAttack to give a voice command to play a song. I'm looking to create a script to randomly play a .mp3 file from a specific folder.

I'm on Windows 8.1

My scripting knowledge is limited to opening and closing programs and creating automated tasks. Any help would be appreciated, thank you.

0

1 Answer 1

2

Install AutoHotKey (http://www.autohotkey.com/) and following their tutorial on the basics (http://www.autohotkey.com/docs/Tutorial.htm) use this script, replacing the directory assigned to mp3root with your desired mp3 folder:

#singleinstance, force
mp3root = d:\mp3collection
IfNotExist, %mp3root%
 exitapp

menu, tray, NoStandard 
menu, tray, icon, shell32.dll, 138

FileList = 
Loop %mp3root%\*.mp3,, 1
{Listsize++
 FileList%Listsize% = %A_LoopFileFullPath%
}

menu, tray, tip, TinyShuffle - %Listsize% items

loop 
{
Random, rand, 1, %listsize%
randfilename = % filelist%rand%

if rand != %last%
 Soundplay, %randfilename%, wait
last = %rand%
}

#s:: Soundplay,skip

~esc:: exitapp

From: http://www.autohotkey.com/board/topic/51861-tinyshuffle-smallest-mp3-player-on-earth/

I noticed quite a few mentions of successfully pairing VoiceAttack and AutoHotKey for various uses. https://www.google.com/#q=voiceattack+and+autohotkey

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .