Today at work, I wanted to know how to create in Windows 7 a simple icon/shortcut to play a sound on the background, without having any media player opening (in my case, I wanted to play a rimshot sound whenever a colleague would say a relatively bad joke). :-) :-)
I searched for a long time on the web, but I wasn't able to find a simple solution to do this (I found a large amount of webpages helping users to remove ads sounds running on the background, but nothing that really served my purpose).
I then found a post from Aug 11, 2008 posted on one of my favourite blogs I check several times a day: How-To-Geek!!! :-D
This great article was about how to " Create a Shortcut or Hotkey to Mute the System Volume in Windows".
To do so, they used something called NirCmd (available here: http://www.nirsoft.net/utils/nircmd.h…).
And while checking this tool's documentation, I found exactly what I was looking for: the mediaplay command.
Here is the detail about this mediaplay command:
mediaplay [play time] [audio file]
Plays the specified audio file (.mp3, .wav, and so on) for the specified number of milliseconds.
I then decided to share what I did with you guys, and signed up to create my first topic here. ;-)
So here is what you have to do to create a simple shortcut/icon that plays a rimshot sound.
- Download "NirCmd" from the website I mentioned above (at the bottom of the page) and save it on your computer.
- Search on the web or on your computer for the audio file you want to play ("Rimshot.mp3" in this example). You can also download a particular icon for this shortcut ("Rimshot.ico" in this example).
- Copy the "NirCmd.exe", "Rimshot.ico" and "Rimshot.mp3" files in a folder where you have permissions to write data (D:\ in this example).
- Create a shortcut to the newly copied "NirCmd.exe" and type the following in the Target field:
"D:\nircmd.exe" mediaplay 1746 "D:\Rimshot.mp3"
- NB: 1746 refers to the length of the "Rimshot.mp3" sound in milliseconds. I used Audacity to get this number.
- Once this shortcut is created, right-click on it, go to Properties, click on the Change icon button and navigate to your icon file (an error mesage may pop up, you can safely discard it). Click on OK and you're done!
Your shortcut is now ready to be used. You can either copy it anywhere you want (i.e. on your desktop) or directly pin it to the taskbar (which is useful in Windows 7 as you then have a keyboard shortcut to use it).
That's it!! Now double-click on the shortcut or click on the taskbar icon to play that rimshot sound without having any media player opening. ;-)
Now have fun playing around with this, adding shortcuts to your desktop/taskbar to play anything from "Bazinga!" to "Fus-Ro-Dah!" whenever you feel like it. :-D :-D
Thanks for reading my first topic!