Created
March 30, 2013 21:06
-
-
Save ebot/5278333 to your computer and use it in GitHub Desktop.
Sets the volume to 100% and plays random mp3s to test the raspberry pi audio.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require('sys'); | |
function playRandomSound() { | |
var num = Math.floor(Math.random()*13); | |
if (num == 0) { | |
num = "09"; | |
} | |
else if (num < 10) { | |
num = '0' + num; | |
} | |
console.log("Random Nanny Quote " + num); | |
sys.exec("mpg321 " + __dirname + "/drivers/soundboard/mp3s/random/" + num + ".mp3"); | |
} | |
sys.exec( "amixer cset iface=MIXER,name=\"PCM Playback Volume\" 100%"); // Set volume to 100% | |
setInterval(playRandomSound, 8000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment