diff --git a/dist/morsify.js b/dist/morsify.js index 1502045..6f2274e 100644 --- a/dist/morsify.js +++ b/dist/morsify.js @@ -524,14 +524,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi var AudioContext = null; var context = null; - var audio = function audio(text, opts) { + var audio = function audio(text, opts, morseString) { if (AudioContext === null && typeof window !== 'undefined') { AudioContext = window.AudioContext || window.webkitAudioContext; context = new AudioContext(); } var options = getOptions(opts); - var morse = encode(text, opts); + var morse = morseString || encode(text, opts); var oscillator = context.createOscillator(); var gainNode = context.createGain(); var timeout; diff --git a/dist/morsify.min.js b/dist/morsify.min.js index fbb67f7..62938ca 100644 --- a/dist/morsify.min.js +++ b/dist/morsify.min.js @@ -1 +1 @@ -function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(a){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a))return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b { + const audio = (text, opts, morseString) => { if (AudioContext === null && typeof window !== 'undefined') { AudioContext = window.AudioContext || window.webkitAudioContext; @@ -188,7 +188,7 @@ } const options = getOptions(opts); - const morse = encode(text, opts); + const morse = morseString || encode(text, opts); const oscillator = context.createOscillator(); const gainNode = context.createGain();