diff --git a/core/recorder.py b/core/recorder.py
index d7c0346..c2cdee8 100644
--- a/core/recorder.py
+++ b/core/recorder.py
@@ -201,6 +201,7 @@ class Recorder:
audio_data_list = []
while self.__running:
try:
+ cfg.load_config()
record = cfg.config['source']['record']
if not record['enabled'] and not self.is_remote:
time.sleep(0.1)
diff --git a/tts/ali_tss.py b/tts/ali_tss.py
index 15530b9..8ce7b21 100644
--- a/tts/ali_tss.py
+++ b/tts/ali_tss.py
@@ -93,7 +93,7 @@ class Speech:
httpHeaders = {
'Content-Type': 'application/json'
}
- text = f"{text}"
+ text = f"{text}"
# 设置HTTPS Body。
body = {'appkey': self.ali_nls_app_key, 'token': self.token,'speech_rate':0, 'text': text, 'format': 'wav', 'sample_rate': 16000, 'voice': config_util.config["attribute"]["voice"]}
body = json.dumps(body)
@@ -117,8 +117,7 @@ class Speech:
util.log(1, "[x] 原因: " + str(body))
file_url = None
return file_url
- conn.close()
- print(time.time() - tt)
+ conn.close()
return file_url
else:
util.log(1, "[x] 语音转换失败!")
diff --git a/utils/config_util.py b/utils/config_util.py
index 70ea695..1bb34b3 100644
--- a/utils/config_util.py
+++ b/utils/config_util.py
@@ -124,5 +124,6 @@ def save_config(config_data):
file = codecs.open('config.json', mode='w', encoding='utf-8')
file.write(json.dumps(config, sort_keys=True, indent=4, separators=(',', ': ')))
file.close()
+ load_config()
# for line in json.dumps(config, sort_keys=True, indent=4, separators=(',', ': ')).split("\n"):
# print(line)