Skip to content

Commit

Permalink
Merge pull request #162 from BoatsAreRockable/issue-160
Browse files Browse the repository at this point in the history
Fix #160
  • Loading branch information
Charlie Lee committed May 3, 2016
2 parents 70370de + 3fef284 commit cdeca54
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions app/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var width = 640,
inputChangeFR = document.querySelector("#input-fr-change"),

// Audio
captureAudio = new Audio("audio/camera.wav"),
captureAudio = "audio/camera.wav",
playAudio = true,

// Status bar
Expand Down Expand Up @@ -523,14 +523,15 @@ function _toggleOnionSkin(ev) {
}

/**
* Play audio if checkbox checked
* @param {String} name Name of variable with audio file.
* Play audio if checkbox checked.
* @param {String} file Location of audio file to play.
*/
function audio(name) {
"use strict";
if (playAudio) {
name.play();
}
function audio(file) {
"use strict";
if (playAudio) {
var audio = new Audio(file);
audio.play();
}
}

function takePicture() {
Expand Down

0 comments on commit cdeca54

Please sign in to comment.