diff options
| author | jmoenig <jens@moenig.org> | 2014-02-04 16:14:16 +0100 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2014-02-04 16:14:16 +0100 |
| commit | 0322b6e3db13355e8bf37db7ab6df7d88875d4b4 (patch) | |
| tree | bbebd3819c401ff85e4e5f7f9ed9109bc3a7362f /objects.js | |
| parent | 268ece61031560010acebfa85580e879c9017782 (diff) | |
| download | snap-yow-0322b6e3db13355e8bf37db7ab6df7d88875d4b4.tar.gz snap-yow-0322b6e3db13355e8bf37db7ab6df7d88875d4b4.zip | |
integrate Dean's sound fix
so JSLint doesn’t complain (no functionality changes). Thanks, Dean!
Diffstat (limited to 'objects.js')
| -rw-r--r-- | objects.js | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -5658,8 +5658,9 @@ Note.prototype.setupContext = function () { window.msAudioContext || window.oAudioContext || window.webkitAudioContext; - if (!ctx.prototype.hasOwnProperty('createGain')) + if (!ctx.prototype.hasOwnProperty('createGain')) { ctx.prototype.createGain = ctx.prototype.createGainNode; + } return ctx; }()); if (!AudioContext) { @@ -5674,10 +5675,12 @@ Note.prototype.setupContext = function () { Note.prototype.play = function () { this.oscillator = this.audioContext.createOscillator(); - if (!this.oscillator.start) + if (!this.oscillator.start) { this.oscillator.start = this.oscillator.noteOn; - if (!this.oscillator.stop) + } + if (!this.oscillator.stop) { this.oscillator.stop = this.oscillator.noteOff; + } this.oscillator.type = 0; this.oscillator.frequency.value = Math.pow(2, (this.pitch - 69) / 12) * 440; |
