summaryrefslogtreecommitdiff
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.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 8edae7c9..5b8d3610 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -796,11 +796,12 @@ class Display {
this.audioPlaying = null;
}
- let audio, source, info;
+ let audio, info;
try {
const {sources, textToSpeechVoice, customSourceUrl} = this.options.audio;
- ({audio, source} = await this.audioSystem.getDefinitionAudio(expression, sources, {textToSpeechVoice, customSourceUrl}));
- info = `From source ${1 + sources.indexOf(source)}: ${source}`;
+ let index;
+ ({audio, index} = await this.audioSystem.getDefinitionAudio(expression, sources, {textToSpeechVoice, customSourceUrl}));
+ info = `From source ${1 + index}: ${sources[index]}`;
} catch (e) {
if (this.audioFallback === null) {
this.audioFallback = new Audio('/mixed/mp3/button.mp3');