部分TTS参数调整

This commit is contained in:
Sakura-RanChen
2026-02-27 16:37:31 +08:00
parent 0d1c18f5dd
commit b49c4520f9
13 changed files with 110 additions and 20 deletions
@@ -15,7 +15,6 @@ class TTSProvider(TTSProviderBase):
self.url = config.get("url")
self.method = config.get("method", "GET")
self.headers = config.get("headers", {})
self.format = config.get("format", "wav")
self.audio_file_type = config.get("format", "wav")
self.output_file = config.get("output_dir", "tmp/")
self.params = config.get("params")
@@ -29,7 +28,7 @@ class TTSProvider(TTSProviderBase):
raise TypeError("Custom TTS配置参数出错, 请参考配置说明")
def generate_filename(self):
return os.path.join(self.output_file, f"tts-{datetime.now().date()}@{uuid.uuid4().hex}.{self.format}")
return os.path.join(self.output_file, f"tts-{datetime.now().date()}@{uuid.uuid4().hex}.{self.audio_file_type}")
async def text_to_speak(self, text, output_file):
request_params = {}