mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-27 04:49:47 +01:00
Merge pull request #2197 from ifnofi/tts_aliyun_cosyvoice
添加阿里云CosyVoice 和 修复文件编码
This commit is contained in:
commit
9f8ae62ebb
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue