mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-29 18:23:59 +08:00
Merge pull request #2197 from ifnofi/tts_aliyun_cosyvoice
添加阿里云CosyVoice 和 修复文件编码
This commit is contained in:
@@ -55,7 +55,7 @@ class WakeupWordsConfig:
|
|||||||
return self._config_cache
|
return self._config_cache
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(self.config_file, "a+") as f:
|
with open(self.config_file, "a+", encoding="utf-8") as f:
|
||||||
with FileLock(f, timeout=self._lock_timeout):
|
with FileLock(f, timeout=self._lock_timeout):
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
content = f.read()
|
content = f.read()
|
||||||
@@ -73,7 +73,7 @@ class WakeupWordsConfig:
|
|||||||
def _save_config(self, config: Dict):
|
def _save_config(self, config: Dict):
|
||||||
"""保存配置到文件,使用文件锁保护"""
|
"""保存配置到文件,使用文件锁保护"""
|
||||||
try:
|
try:
|
||||||
with open(self.config_file, "w") as f:
|
with open(self.config_file, "w", encoding="utf-8") as f:
|
||||||
with FileLock(f, timeout=self._lock_timeout):
|
with FileLock(f, timeout=self._lock_timeout):
|
||||||
yaml.dump(config, f, allow_unicode=True)
|
yaml.dump(config, f, allow_unicode=True)
|
||||||
self._config_cache = config
|
self._config_cache = config
|
||||||
|
|||||||
Reference in New Issue
Block a user