summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/audio.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-18 21:10:48 -0400
committerGitHub <noreply@github.com>2020-04-18 21:10:48 -0400
commit03d77cc3a6c4dfb15fa83c6caa60563103ca7776 (patch)
tree67911632b8614e3c170dee6db731df9a43cbc42a /ext/bg/js/settings/audio.js
parent7a03ce0194fafb0c2e49994dc6efd33d5fdb6a07 (diff)
parent320852f2d01d72c1039d098033081e8266d02be7 (diff)
Merge pull request #442 from toasted-nutbread/audio-system-refactoring
Audio system refactoring
Diffstat (limited to 'ext/bg/js/settings/audio.js')
-rw-r--r--ext/bg/js/settings/audio.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/bg/js/settings/audio.js b/ext/bg/js/settings/audio.js
index 3c6e126c..ac2d82f3 100644
--- a/ext/bg/js/settings/audio.js
+++ b/ext/bg/js/settings/audio.js
@@ -18,7 +18,6 @@
/* global
* AudioSourceUI
* AudioSystem
- * apiAudioGetUri
* getOptionsContext
* getOptionsMutable
* settingsSaveOptions
@@ -29,10 +28,8 @@ let audioSystem = null;
async function audioSettingsInitialize() {
audioSystem = new AudioSystem({
- getAudioUri: async (definition, source) => {
- const optionsContext = getOptionsContext();
- return await apiAudioGetUri(definition, source, optionsContext);
- }
+ audioUriBuilder: null,
+ useCache: true
});
const optionsContext = getOptionsContext();
@@ -115,7 +112,7 @@ function textToSpeechTest() {
const text = document.querySelector('#text-to-speech-voice-test').dataset.speechText || '';
const voiceUri = document.querySelector('#text-to-speech-voice').value;
- const audio = audioSystem.createTextToSpeechAudio({text, voiceUri});
+ const audio = audioSystem.createTextToSpeechAudio(text, voiceUri);
audio.volume = 1.0;
audio.play();
} catch (e) {