Skip to content

Commit

Permalink
Fixed error, when not using Web Audio
Browse files Browse the repository at this point in the history
  • Loading branch information
ekelokorpi committed Apr 3, 2020
1 parent 35a16a8 commit 45b637f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/engine/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ game.createClass('Sound', {

this._source.buffer = this._buffer;
this._source.loop = this.loop;
if (this._source.playbackRate) this._source.playbackRate.setValueAtTime(this.rate, this._context.currentTime);
if (this._source.playbackRate && this._context) this._source.playbackRate.setValueAtTime(this.rate, this._context.currentTime);
this._source.onended = this._onComplete.bind(this);
if (this._source.connect) {
this._source.connect(this._gainNode);
Expand Down

0 comments on commit 45b637f

Please sign in to comment.