Skip to content

Commit 30c13d7

Browse files
committed
Use context current time for play and stop, v0.5.3
1 parent 16c19a1 commit 30c13d7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

dist/morsify.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "morsify",
3-
"version": "0.5.2",
3+
"version": "0.5.3",
44
"description": "Morse code translator and decoder which also generates audio.",
55
"keywords": [
66
"morse",

src/morsify.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
oscillator: {
160160
type: options.oscillator.type || 'sine', // sine, square, sawtooth, triangle
161161
frequency: options.oscillator.frequency || 500, // value in hertz
162-
onended: options.oscillator.onended || null, // event that fires when the tone has stopped playing
162+
onended: options.oscillator.onended || null // event that fires when the tone has stopped playing
163163
}
164164
};
165165
characters[0] = characters[options.priority];
@@ -226,11 +226,11 @@
226226

227227
return {
228228
play: function () {
229-
oscillator.start();
230-
oscillator.stop(t);
229+
oscillator.start(context.currentTime);
230+
oscillator.stop(context.currentTime + t);
231231
},
232232
stop: function () {
233-
oscillator.stop();
233+
oscillator.stop(context.currentTime);
234234
},
235235
context: context,
236236
oscillator: oscillator,

0 commit comments

Comments
 (0)