Download or create your own USB music shuffler.
You’re hosting a party, and Spotify is repeating the same 5 songs over and over with too many ads, so you fill up an old USB stick with songs from a hard drive. To keep everything easy, you plug it directly into your speaker. (This also stops those pesky party goers who like to play DJ, so you never hear more than 30 seconds of each song as they constantly flick through.) Everything is working fine, except after a few songs you realize that the songs are playing in alphabetical order. That Elvis Presley CD that you ripped lists its songs as ‘Track01’, ‘Track02’, ‘Track03’, etc. and you are getting an Elvis overload all in one go!
Never fear, the USB song shuffler is here!…With no interface between the USB and speaker, you can’t tell it to play the songs shuffled. The option simply doesn’t exist. The only way that you can think to ‘shuffle’ the songs is to rename all of them randomly to jumble the order. You’ve got 1000 songs lined up and that sounds like too much hard work.
This Windows File Shuffler program asks you to select the folder that holds all of the songs. (Please make sure that only the songs are in this folder, nothing else.) It will then grab all of them, generate random numbers and rename them all, giving you a jumbled playlist order. This works best if you copy them all onto the USB first, then shuffle the USB, so it’s literally a 2 second job. Plug the USB in, open the program, select the USB, and bam!, your songs are shuffled.
Why am I sharing this?
Because I needed a solution to this exact problem, and I’m quite new to programming and was far too impressed when I made this, and I just had to tell people, but the people in my immediate area couldn’t have cared less.
This kind of goes without saying but always keep a backup of your music or other files before doing anything to them. This program does not create a copy for you, it just renames the actual files in the folder that you select.
For those of you who are too paranoid to download exes from a random blog post (none taken), the raw C# code below should give you all the information that you need to recreate the program yourself 🙂
If you are planning on recreating by copying the entire code, just know that my Form contains a text box labelled ‘txt_extention’ which contains default text ‘.mp3’ and a start button labelled ‘btn_Start’.
Enjoy your party!
public partial class Form1 : Form
private void btn_Start_Click(object sender, EventArgs e)
folder.ShowDialog(); //Let user select directory
if (folder.SelectedPath == "")
string fileArray = Directory.GetFiles(folder.SelectedPath); //Adds all files in that folder to an array
string outputPath = folder.SelectedPath + "\\Output"; //Sets the output folder to an output folder at that directory
List nums = new List();
Random rndm = new Random();
int total = fileArray.Count();
int i = 0;
while (nums.Count != total)
num = rndm.Next(0, total);
//dont add it again, re-roll dice!
nums.Add(num);//add number to list
// lst_outputnums.Items.Add(num);//Visually add it to a list
//Rename file accordingly
string fileName = fileArray[i].ToString();
System.IO.File.Move(fileName, outputPath + "\\" + num + txt_extention.Text);
i++; //Increment Files
btn_Start.Enabled = false;
btn_Start.Text = "Shuffled";
Form1 fm = this;
(This Windows C# program shuffles any files, not just mp3s. You can manually adjust the output file type within the program. So if you need to shuffle any files, not just songs, then go ahead. if this program helps you, let me know about it below!)
|DJ. T is a microphone maestro – a beat blender – a smooth and tender problem mender. His shows are broadcast live from various underground stations featured in Moppers Anonymous.
To spread awareness and recruit for his cause, DJ.T will now be co-hosting occasional shows at jbestbooks.com. Stay tuned.