use injector restart in airGuitar script

This commit is contained in:
Stephen Birarda 2015-02-12 11:44:14 -08:00
parent 5f4e3528c2
commit 70e085009b

View file

@ -138,10 +138,15 @@ function playChord(position, volume) {
}
print("Played sound: " + whichChord + " at volume " + options.volume);
soundPlaying = Audio.playSound(chords[guitarSelector + whichChord], {
position: position,
volume: volume
});
if (!soundPlaying) {
soundPlaying = Audio.playSound(chords[guitarSelector + whichChord], {
position: position,
volume: volume
});
} else {
soundPlaying.restart();
}
}
function keyPressEvent(event) {