Permalink
Browse files

switched tts api for firefox support

  • Loading branch information...
Kadauchi committed Dec 31, 2017
1 parent 959dc58 commit d084bdd9fecb4c4ebd00e3e3f0f30fc0b2ee2a3c
Showing with 20 additions and 14 deletions.
  1. +6 −5 hit_catcher/hit_catcher.js
  2. +5 −1 hit_finder/hit_finder.js
  3. +9 −5 hit_tracker/hit_tracker.js
  4. +0 −3 manifest.json
View
@@ -675,11 +675,12 @@ function catcherCaptchaFound() {
}
}
function textToSpeech(phrase, options) {
chrome.tts.speak(phrase, {
enqueue: true,
voiceName: `Google US English`
});
speechSynthesis.getVoices();
function textToSpeech(phrase) {
const message = new SpeechSynthesisUtterance(phrase);
message.voice = speechSynthesis.getVoices().filter((voice) => voice.name == `Google US English`)[0];
window.speechSynthesis.speak(message);
}
document.getElementById(`pause`).addEventListener(`click`, catcherPauseToggle);
View
@@ -1288,8 +1288,12 @@ function reviewModal(requesterId) {
$(modal).modal(`show`);
}
speechSynthesis.getVoices();
function textToSpeech(phrase) {
chrome.tts.speak(phrase, { enqueue: true, voiceName: `Google US English` });
const message = new SpeechSynthesisUtterance(phrase);
message.voice = speechSynthesis.getVoices().filter((voice) => voice.name == `Google US English`)[0];
window.speechSynthesis.speak(message);
}
function timeNow() {
View
@@ -520,11 +520,7 @@ function sycningEnded() {
}
function loggedOut() {
chrome.tts.speak(`Attention, you are logged out of MTurk.`, {
enqueue: true,
voiceName: `Google US English`
});
textToSpeech(`Attention, you are logged out of MTurk.`);
sycningEnded();
}
@@ -715,6 +711,14 @@ document.getElementById(`sync-last-45-days`).addEventListener(`click`, async (e)
});
})();
speechSynthesis.getVoices();
function textToSpeech(phrase) {
const message = new SpeechSynthesisUtterance(phrase);
message.voice = speechSynthesis.getVoices().filter((voice) => voice.name == `Google US English`)[0];
window.speechSynthesis.speak(message);
}
View
@@ -25,8 +25,6 @@
"persistent": true
},
"incognito": "split",
"minimum_chrome_version": "61",
"offline_enabled": true,
@@ -38,7 +36,6 @@
"options_page": "options/options.html",
"permissions": [
"tts",
"tabs",
"activeTab",
"storage",

0 comments on commit d084bdd

Please sign in to comment.