Skip to content

Commit

Permalink
dont speak same message twice and only save messages every two seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
sl5net committed Sep 1, 2023
1 parent b71554f commit 0c99eb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gui/lobby/LobbyPage/Chat/ChatMessages/ChatMessageFormatSay.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ class ChatMessageFormatSay

if(true){
const diffSeconds = Math.abs((new Date()) - g_AudioTTSspeak_lastSpeak) / 1000;
// warn(JSON.stringify(diffSeconds));
// warn(`22: diffSeconds: ${diffSeconds}`);
// const diffMin = Math.round( Math.abs((new Date()) - this.dateStart) / 1000 / 60 * 10) / 10;
// limit save moments
if(diffSeconds > 2){
g_AudioTTSspeak_lastSpeak = new Date();
const ttsSolution = Engine.ConfigDB_GetValue("user", "autocivP.ttsSolution")
if(ttsSolution == "autokeyTTS")
ConfigDB_CreateAndSaveValueA26A27("user", `AudioTTS.speak`, temp.replace('\n', ' ').replace('"', '')); // just for fun experimental
Expand Down
3 changes: 3 additions & 0 deletions moddata/0ad_TTS_userCfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ def espeakThis(m, lang = 'en'):


espeakThis("Gleich gehts los" , 'de')
time.sleep(2)
espeakThis("esta por comenzar" , 'es')


# espeakThis("espeak script started")

Expand Down

0 comments on commit 0c99eb4

Please sign in to comment.