update airGuitar.js to new AudioInjectionOptions format

This commit is contained in:
Stephen Birarda 2014-11-11 10:26:53 -08:00
parent a8681cd5b6
commit 05174ffdf3

View file

@ -132,15 +132,16 @@ function checkHands(deltaTime) {
}
function playChord(position, volume) {
var options = new AudioInjectionOptions();
options.position = position;
options.volume = volume;
if (Audio.isInjectorPlaying(soundPlaying)) {
print("stopped sound");
Audio.stopInjector(soundPlaying);
}
print("Played sound: " + whichChord + " at volume " + options.volume);
soundPlaying = Audio.playSound(chords[guitarSelector + whichChord], options);
soundPlaying = Audio.playSound(chords[guitarSelector + whichChord], {
position: position,
volume: volume
});
}
function keyPressEvent(event) {