Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
30 lines
634 B
JavaScript
Executable file
30 lines
634 B
JavaScript
Executable file
'use strict';
|
|
|
|
(function(exports) {
|
|
|
|
var listeners = {};
|
|
|
|
var MockSpeechSynthesisUtterance = function() {
|
|
this.addEventListener = function(name, callback) {
|
|
listeners[name] = callback;
|
|
};
|
|
};
|
|
|
|
var MockSpeechSynthesis = {
|
|
cancel: function() {},
|
|
speak: function() {
|
|
if (listeners.start) {
|
|
listeners.start();
|
|
}
|
|
if (listeners.end) {
|
|
listeners.end();
|
|
}
|
|
},
|
|
getVoices: function() {
|
|
return [{ lang: 'en-US' }];
|
|
}
|
|
};
|
|
|
|
exports.MockSpeechSynthesisUtterance = MockSpeechSynthesisUtterance;
|
|
exports.MockSpeechSynthesis = MockSpeechSynthesis;
|
|
}(window));
|