From cca01e85a35576225661699a7be63550e9500642 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 30 May 2021 12:41:19 -0400 Subject: Improve multiple audio sources (#1718) * Add url/voice options to audio sources * Add help for TTS * Remove old settings * Update tests * Update use of audio source URL * Improve labels for sources with the same type --- ext/js/data/options-util.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'ext/js/data') diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index 89d50903..eb29dae4 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -826,16 +826,21 @@ class OptionsUtil { sentenceParsing.terminationCharacterMode = sentenceParsing.enableTerminationCharacters ? 'custom' : 'newlines'; delete sentenceParsing.enableTerminationCharacters; - const {sources, customSourceType} = audio; + const {sources, customSourceUrl, customSourceType, textToSpeechVoice} = audio; audio.sources = sources.map((type) => { switch (type) { + case 'text-to-speech': + case 'text-to-speech-reading': + return {type, url: '', voice: textToSpeechVoice}; case 'custom': - return (customSourceType === 'json' ? 'custom-json' : 'custom'); + return {type: (customSourceType === 'json' ? 'custom-json' : 'custom'), url: customSourceUrl, voice: ''}; default: - return type; + return {type, url: '', voice: ''}; } }); delete audio.customSourceType; + delete audio.customSourceUrl; + delete audio.textToSpeechVoice; } return options; } -- cgit v1.2.3