From 9126f1518b4d458d1c3424bfd62948ebc5d2575c Mon Sep 17 00:00:00 2001 From: gpkvt Date: Sun, 14 Aug 2022 18:51:23 +0200 Subject: [PATCH] Added config option for TTS_URL --- build/scripts/lib/config.py | 6 +++++- build/www/index.py | 3 ++- build/www/obs_settings.py | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build/scripts/lib/config.py b/build/scripts/lib/config.py index 31376ac..339cac6 100644 --- a/build/scripts/lib/config.py +++ b/build/scripts/lib/config.py @@ -60,7 +60,8 @@ vars = [ 'CHAT_HEIGHT', 'DEBUG', 'EXTDATA', - 'TTS' + 'TTS', + 'TTS_URL' ] def get_config(): @@ -87,6 +88,9 @@ def get_config(): logging.warning('Debug-Mode is active') conf['DEBUG'] = True + if not conf['TTS_URL']: + conf['TTS_URL'] = "http://localhost/tts" + if not conf['EXTDATA']: conf['EXTDATA'] = False else: diff --git a/build/www/index.py b/build/www/index.py index f384809..0af4e7b 100644 --- a/build/www/index.py +++ b/build/www/index.py @@ -44,6 +44,7 @@ offline_scene = obs_settings.offline_scene channel = obs_settings.channel chat_height = obs_settings.chat_height tts = obs_settings.tts +tts_url = obs_settings.tts_url if not chat_height: chat_height = int(500) @@ -116,7 +117,7 @@ if connected: if tts: print('
') - print(' ') + print(' '.format(str(tts_url))) print('
Show/Hide chat
') print('
') diff --git a/build/www/obs_settings.py b/build/www/obs_settings.py index a8d0e65..812f73c 100644 --- a/build/www/obs_settings.py +++ b/build/www/obs_settings.py @@ -14,3 +14,4 @@ debug = os.environ.get('DEBUG', False) chat_height = os.environ.get('CHAT_HEIGHT', 500) extdata = os.environ.get('EXTDATA', False) tts = os.environ.get('TTS', False) +tts_url = os.environ.get('TTS_URL', 'http://localhost/tts')