Skip to content

Commit 1808fab

Browse files
Calling stop method when sound ends
1 parent 53dbf05 commit 1808fab

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

v3/src/sound/webaudio/WebAudioSound.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ var WebAudioSound = new Class({
109109
this.source.buffer = this.audioBuffer;
110110
this.source.connect(this.muteNode);
111111
this.applyConfig();
112-
// TODO add onended event handler to reset sound state
112+
this.source.onended = function (ev) {
113+
this.stop();
114+
}.bind(this);
113115
this.source.start(0, offset, duration);
114116
},
115117
/**

0 commit comments

Comments
 (0)