Added config option for TTS_URL

This commit is contained in:
gpkvt 2022-08-14 18:51:23 +02:00
parent 727d7e8a6b
commit 9126f1518b
3 changed files with 8 additions and 2 deletions

View File

@ -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:

View File

@ -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('<div id="tts">')
print(' <iframe id="ttsframe" style="display:none;" scrolling="0" frameborder="0" src="/tts" height="500px" width="100%"></iframe>')
print(' <iframe id="ttsframe" style="display:none;" scrolling="0" frameborder="0" src="{0]" height="500px" width="100%"></iframe>'.format(str(tts_url)))
print(' <div class="status" onClick="$(\'#ttsframe\').fadeToggle(\'slow\', \'linear\');">Show/Hide chat</div>')
print('</div>')

View File

@ -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')