aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index a62e0212..689fa7e4 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -43,12 +43,7 @@ class Display extends EventDispatcher {
this._audioPlaying = null;
this._audioFallback = null;
this._audioSystem = new AudioSystem({
- audioUriBuilder: {
- getUri: async (source, expression, reading, details) => {
- return await api.audioGetUri(source, expression, reading, details);
- }
- },
- useCache: true
+ getAudioInfo: this._getAudioInfo.bind(this)
});
this._styleNode = null;
this._eventListeners = new EventListenerCollection();
@@ -165,6 +160,7 @@ class Display extends EventDispatcher {
}
async prepare() {
+ this._audioSystem.prepare();
this._updateMode();
this._setInteractive(true);
await this._displayGenerator.prepare();
@@ -1096,7 +1092,7 @@ class Display extends EventDispatcher {
try {
const {sources, textToSpeechVoice, customSourceUrl} = this._options.audio;
let index;
- ({audio, index} = await this._audioSystem.getDefinitionAudio(sources, expression, reading, {textToSpeechVoice, customSourceUrl}));
+ ({audio, index} = await this._audioSystem.createDefinitionAudio(sources, expression, reading, {textToSpeechVoice, customSourceUrl}));
info = `From source ${1 + index}: ${sources[index]}`;
} catch (e) {
if (this._audioFallback === null) {
@@ -1419,4 +1415,8 @@ class Display extends EventDispatcher {
modeOptions
});
}
+
+ async _getAudioInfo(source, expression, reading, details) {
+ return await api.getDefinitionAudioInfo(source, expression, reading, details);
+ }
}